infinitewisdom.model
Class GameWorld

java.lang.Object
  extended by infinitewisdom.model.GameWorld
All Implemented Interfaces:
TimerStepIF, java.io.Serializable
Direct Known Subclasses:
GameWorldDom1

public class GameWorld
extends java.lang.Object
implements TimerStepIF, java.io.Serializable

Contains all the units and players. When saving the game this class gets serialized. Also used for unit lookup in a specific region of the map. ( getCloseUnits )

See Also:
Serialized Form

Field Summary
static double errorMargin
           
protected  java.util.List<ServerUnitIF> freshlyCreatedUnits
           
protected  java.util.List<PlayerIF> players
           
 Vec2f size
           
protected  java.util.HashMap<java.lang.Long,UnitIF> unitDic
           
protected  java.util.List<ServerUnitIF> units
           
 
Constructor Summary
GameWorld(Vec2f s)
           
 
Method Summary
 void createUnit(ServerUnitIF inst)
           
 void flushFreshlyCreatedUnits()
           
 java.util.List<UnitIF> getCloseUnits(Vec2f center, double tolerance)
           
 java.util.List<UnitIF> getFreshlyCreatedUnits()
           
 java.util.List<PlayerIF> getPlayers()
           
 java.util.List<UnitIF> getUnits()
           
 void initUnitHash()
          Assumes the field "units" is already initialized.
 void setGameWorldinfresh()
           
 void step()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

units

protected java.util.List<ServerUnitIF> units

players

protected java.util.List<PlayerIF> players

freshlyCreatedUnits

protected java.util.List<ServerUnitIF> freshlyCreatedUnits

unitDic

protected java.util.HashMap<java.lang.Long,UnitIF> unitDic

errorMargin

public static double errorMargin

size

public Vec2f size
Constructor Detail

GameWorld

public GameWorld(Vec2f s)
Method Detail

initUnitHash

public void initUnitHash()
Assumes the field "units" is already initialized.


step

public void step()
Specified by:
step in interface TimerStepIF

getUnits

public java.util.List<UnitIF> getUnits()

getPlayers

public java.util.List<PlayerIF> getPlayers()

getFreshlyCreatedUnits

public java.util.List<UnitIF> getFreshlyCreatedUnits()

setGameWorldinfresh

public void setGameWorldinfresh()

flushFreshlyCreatedUnits

public void flushFreshlyCreatedUnits()

getCloseUnits

public java.util.List<UnitIF> getCloseUnits(Vec2f center,
                                            double tolerance)

createUnit

public void createUnit(ServerUnitIF inst)