|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.Simulation
public class Simulation
The Simulation class is the primary singleton class in the MSP simulation. It's capable of creating a new simulation or loading/saving an existing one.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_DIR
|
static java.lang.String |
DEFAULT_FILE
|
static java.lang.String |
VERSION
|
Method Summary | |
---|---|
void |
clockPulse(double time)
Clock pulse from master clock |
static void |
createNewSimulation()
Creates a new simulation instance. |
CreditManager |
getCreditManager()
Gets the credit manager. |
HistoricalEventManager |
getEventManager()
Get the historical event manager. |
MalfunctionFactory |
getMalfunctionFactory()
Get the malfunction factory. |
Mars |
getMars()
Get the planet Mars. |
MasterClock |
getMasterClock()
Get the master clock. |
MedicalManager |
getMedicalManager()
Get the medical manager. |
MissionManager |
getMissionManager()
Get the mission manager. |
RelationshipManager |
getRelationshipManager()
Get the relationship manager. |
UnitManager |
getUnitManager()
Get the unit manager. |
static Simulation |
instance()
Gets a singleton instance of the simulation. |
boolean |
isDefaultLoad()
Checks if simulation was loaded from default save file. |
void |
loadSimulation(java.io.File file)
Loads a simulation instance from a save file. |
void |
saveSimulation(java.io.File file)
Saves a simulation instance to a save file. |
void |
start()
Start the simulation. |
void |
stop()
Stop the simulation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static final java.lang.String DEFAULT_FILE
public static final java.lang.String DEFAULT_DIR
Method Detail |
---|
public static Simulation instance()
public static void createNewSimulation() throws java.lang.Exception
java.lang.Exception
- if new simulation could not be created.public void loadSimulation(java.io.File file) throws java.lang.Exception
file
- the file to be loaded from.
java.lang.Exception
- if simulation could not be loaded.public void saveSimulation(java.io.File file) throws java.lang.Exception
file
- the file to be saved to.
java.lang.Exception
- if simulation could not be saved.public void start()
public void stop()
public void clockPulse(double time)
clockPulse
in interface ClockListener
time
- amount of time passing (in millisols)public Mars getMars()
public UnitManager getUnitManager()
public MissionManager getMissionManager()
public RelationshipManager getRelationshipManager()
public CreditManager getCreditManager()
public MalfunctionFactory getMalfunctionFactory()
public HistoricalEventManager getEventManager()
public MedicalManager getMedicalManager()
public MasterClock getMasterClock()
public boolean isDefaultLoad()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |