|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--noope.core.Physics
This is the main wrapper class around Laws and Entities. It initialises itself from the supplied BlockReader, and constructs all Entity and Law objects, which are stored in private Entities and Laws list objects.
Constructor Summary | |
Physics(BlockReader brPhysics)
Construct a Physics object from the supplied BlockReader, and initialise the Laws and Entities lists. |
|
Physics(BlockReader brPhysics,
LawLoader lawL,
EntityLoader entL,
LawPropertyRecordLoader lawPRL)
Constructs a new Physics object, just as the other constructor, but you can specify the XXXXLoader objects to use. |
Method Summary | |
void |
dispose()
Disposes of resources by calling dispose() on the list of entities and the list of laws. |
Entities |
getEntities()
Provide access to the list of Entities |
EntityLoader |
getEntityLoader()
Returns the EntityLoader object used by this Physics object. |
LawLoader |
getLawLoader()
Returns the LawLoader object used by this Physics object. |
LawPropertyRecordLoader |
getLawPropertyRecordLoader()
Returns the LawPropertyRecordLoader object used by this Physics object. |
Laws |
getLaws()
Provide access to the list of Laws |
double |
getTime()
Provide access to the current universal time |
void |
run(double duration,
double deltaTime)
Run the simulation for a time duration, in intervals of deltaTime This method resets the internal time to zero, then calls step(deltaTime) repeatedly. |
void |
step(double deltaTime)
Run the simulation for a single step of deltaTime. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Physics(BlockReader brPhysics) throws BRLoadingException
brPhysics
- the BlockReader used to initialise private Laws and Entities objectsBRLoadingException
- if it finds anything wrong with the format of the data
in the BlockReader passed to it.public Physics(BlockReader brPhysics, LawLoader lawL, EntityLoader entL, LawPropertyRecordLoader lawPRL) throws BRLoadingException
Method Detail |
public Laws getLaws()
public Entities getEntities()
public double getTime()
public void step(double deltaTime)
deltaTime
- amount of time to run the simulation forEntity.step(double)
public void run(double duration, double deltaTime)
duration
- total time to run simulation fordeltaTime
- amount of time by step by at each iterationpublic void dispose()
public LawLoader getLawLoader()
public EntityLoader getEntityLoader()
public LawPropertyRecordLoader getLawPropertyRecordLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |