infinitewisdom.model
Class GameWorld
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
GameWorld
public GameWorld(Vec2f s)
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)