All pastes #73144 Raw Edit

Untitled

public text v1 · immutable
#73144 ·published 2006-06-27 14:25 UTC
rendered paste body
-- For a successful fit, we need to take the maximum current realestate and fit all items within it.
--
-- We need: 
-- Property, Community, World
--
--
--   -------------------------------------------------------------
--   |                                             World (screen)|
--   |                                                           |
--   |           ------------------------------------            |
--   |          |  |     |                  Comm    |            |
--   |          |  | P   |                          |            |
--   |          |  |     |                  --------|            |
--   |          |-----   |                  |       |            |
--   |          |P |_|___|                  | Prop  |            |
--   |          |____|______________________|_______|            |
--   |                                                           |
--   ------------------------------------------------------------ 
--
--   on start, we take the minmax ranges of each section: World, Community and Properties
--   on refresh we first recheck all the property sizes. If the minmax x or y is outside than recorded Comm size, extend Comm
--   if Comm extends outside the World, shift entire community back into the screen.
--   start at corner of community closest to the Worldframe
--   take first property, check for overlap and return horizontal or vertical and move offending property out of overlap
--   check community size and readjust as required
--   take next property and repeat.
--
--   This will take multiple runs before everything settles down =\ Infinite loops possible? Maybe randomly move either of the 
--   properties instead of in a particular order