|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cad.simcad.worldsimulator.world.MyWorld
Implementation of SimEnvironment
Field Summary | |
protected java.util.Vector |
_allObjects
|
protected AbstractMap |
_am
|
protected Owner |
_defaultOwner
|
protected Drawable2DObject[] |
_drObEx
|
protected java.util.Vector |
_gaiaObjects
|
protected Owner |
_gaiaOwner
|
protected java.util.Vector |
_miniMapObjects
|
protected java.util.Vector |
_movingObjects
|
protected java.util.Vector |
_notMovingObjects
|
protected ObjectMediator |
_om
|
protected RandomGenerator |
_rndGen
|
protected long |
_serial
|
protected StructureMediator |
_sm
|
protected SimObjectServer |
_sos
|
protected StatServer |
_ss
|
protected SimViewer |
_sv
|
protected UnitMediator |
_um
|
protected java.util.Vector |
selectedObjects
|
Constructor Summary | |
MyWorld(AbstractMap am,
SimViewer sv)
Creates new LondonTown |
Method Summary | |
void |
addDrawable2DObject(Drawable2DObject d2dObject)
|
void |
addMovingObject(MyUnit mu)
|
void |
addOtherObject(SimObject so)
|
void |
addSimulatedObject(SimObject so)
|
void |
addStaticStructure(PassiveStructure ps)
|
boolean |
checkForRoom(SimObject so)
Returns true if there is room to add the object |
SimObject |
createSimObject(java.lang.String name,
Owner o)
Adds a new Simulated Objects in the World |
SimObject |
createSimObject(java.lang.String name,
Owner o,
PathPlace pp)
Adds a new Simulated Objects in the World |
AbstractMap |
getAbstractMap()
Returns the Map making this world |
Owner |
getDefaultOwner()
Return the default owner for this SimEnvironment |
Owner |
getGaiaOwner()
Returns the Owner known as Gaia i.e Mother Nature |
Drawable2DObject[] |
getMiniMapDrawable2DObjects()
Returns an Array of all the Drawable2DObject the SimWorld knows about |
java.util.Vector |
getMovingSimulatedObjects()
Returns a Vector of the simulated units |
java.util.Vector |
getNotMovingSimulatedBuildings()
Returns a Vector of the simulated structures |
SimObject[][] |
getObjects(int xcenter,
int ycenter,
int halfWidth,
int halfHeight)
Returns the SimObject that can been seen in the area defined by the parameters |
RandomGenerator |
getRandonGenerator()
Returns a Random Generator for this world |
SimObjectServer |
getSimObjectServer()
Returns the SimObjectServer of the SimEnvironment |
java.util.Vector |
getSimulatedObjects()
Returns a Vector of all the simulated Objects |
SimViewer |
getSimViewer()
|
StatServer |
getStatServer()
Returns the StatServer of the SimEnvironment |
java.lang.String[] |
getStructureTypesString()
|
java.util.Vector |
getStructureTypesVector()
Returns a Vector of all the different SimObject of type "structure" |
java.lang.String[] |
getUnitTypesString()
|
java.util.Vector |
getUnitTypesVector()
Returns a Vector of all the different SimObject of type "unit" |
long |
nextSerial()
Returns the next serial number for this SimEnvironment |
void |
removeDrawable2DObject(Drawable2DObject d2dObject)
|
void |
removeMovingObject(MyUnit mu)
|
void |
removeOtherObject(SimObject so)
|
void |
removeSimulatedObject(SimObject so)
Remove the given SimObject from the SimEnvironment |
void |
removeStaticStructure(PassiveStructure ps)
|
void |
setSimViewer(SimViewer sv)
|
void |
updateObjectPosition(SimObject so,
PathPlace oldPathPlace,
PathPlace newPathPlace)
Update the position of the object given in parameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector _movingObjects
protected java.util.Vector _allObjects
protected java.util.Vector _miniMapObjects
protected java.util.Vector _gaiaObjects
protected java.util.Vector _notMovingObjects
protected AbstractMap _am
protected java.util.Vector selectedObjects
protected Drawable2DObject[] _drObEx
protected UnitMediator _um
protected StructureMediator _sm
protected ObjectMediator _om
protected StatServer _ss
protected SimObjectServer _sos
protected Owner _defaultOwner
protected Owner _gaiaOwner
protected long _serial
protected SimViewer _sv
protected RandomGenerator _rndGen
Constructor Detail |
public MyWorld(AbstractMap am, SimViewer sv)
Method Detail |
public void setSimViewer(SimViewer sv)
setSimViewer
in interface SimEnvironment
public SimViewer getSimViewer()
getSimViewer
in interface SimEnvironment
public void updateObjectPosition(SimObject so, PathPlace oldPathPlace, PathPlace newPathPlace)
SimEnvironment
updateObjectPosition
in interface SimEnvironment
so
- The SimObject to updateoldPathPlace
- the old position of the SimObject. oldPathPlace belongs to MapnewPathPlace
- the new position of the SimObject.public void addMovingObject(MyUnit mu)
public void removeMovingObject(MyUnit mu)
public void addStaticStructure(PassiveStructure ps)
public void removeStaticStructure(PassiveStructure ps)
public java.util.Vector getMovingSimulatedObjects()
SimEnvironment
getMovingSimulatedObjects
in interface SimEnvironment
public java.util.Vector getNotMovingSimulatedBuildings()
SimEnvironment
getNotMovingSimulatedBuildings
in interface SimEnvironment
public Drawable2DObject[] getMiniMapDrawable2DObjects()
SimEnvironment
getMiniMapDrawable2DObjects
in interface SimEnvironment
public java.util.Vector getSimulatedObjects()
SimEnvironment
getSimulatedObjects
in interface SimEnvironment
public void removeSimulatedObject(SimObject so)
SimEnvironment
removeSimulatedObject
in interface SimEnvironment
so
- a SimObjectpublic boolean checkForRoom(SimObject so)
public void addSimulatedObject(SimObject so)
public void removeOtherObject(SimObject so)
public void addOtherObject(SimObject so)
public void addDrawable2DObject(Drawable2DObject d2dObject)
public void removeDrawable2DObject(Drawable2DObject d2dObject)
public SimObject[][] getObjects(int xcenter, int ycenter, int halfWidth, int halfHeight)
SimEnvironment
getObjects
in interface SimEnvironment
xcenter
- the x coordinateycenter
- the y coordinatehalfWidth
- the number of coordinates we have to take into account right/left xcenterhalfHeight
- the number of coordinates we have to take into account above/below ycenter
public java.util.Vector getStructureTypesVector()
SimEnvironment
getStructureTypesVector
in interface SimEnvironment
public java.lang.String[] getStructureTypesString()
public java.util.Vector getUnitTypesVector()
SimEnvironment
getUnitTypesVector
in interface SimEnvironment
public java.lang.String[] getUnitTypesString()
public AbstractMap getAbstractMap()
SimEnvironment
getAbstractMap
in interface SimEnvironment
public SimObject createSimObject(java.lang.String name, Owner o)
SimEnvironment
createSimObject
in interface SimEnvironment
name
- the name of the Object to createo
- the Owner of this object to be made
public SimObject createSimObject(java.lang.String name, Owner o, PathPlace pp)
SimEnvironment
createSimObject
in interface SimEnvironment
name
- the name of the Object to createo
- the Owner of this object to be madepp
- the PathPlace where the new Object should be placed
public Owner getDefaultOwner()
getDefaultOwner
in interface SimEnvironment
public Owner getGaiaOwner()
getGaiaOwner
in interface SimEnvironment
public SimObjectServer getSimObjectServer()
SimEnvironment
getSimObjectServer
in interface SimEnvironment
public long nextSerial()
nextSerial
in interface SimEnvironment
public RandomGenerator getRandonGenerator()
getRandonGenerator
in interface SimEnvironment
public StatServer getStatServer()
SimEnvironment
getStatServer
in interface SimEnvironment
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |