private SafetyMutex mutex = SafetyMutex.newInstance();
private final Rocket rocket;
- private final OpenRocketDocument document;
private String name = "";
*
* @param rocket the rocket associated with the simulation.
*/
- public Simulation(OpenRocketDocument doc, Rocket rocket) {
- // It may seem silly to pass in the document and rocket, since usually when called we
- // use doc.getRocket, but I guess there is some reason; when cloning a simulation + rocket we don't need
- // to make a duplicate of the undo data etc stored in the document. --Richard
- this.document = doc;
+ public Simulation(Rocket rocket) {
this.rocket = rocket;
this.status = Status.NOT_SIMULATED;
}
- public Simulation(OpenRocketDocument doc, Rocket rocket, Status status, String name, SimulationOptions options,
+ public Simulation(Rocket rocket, Status status, String name, SimulationOptions options,
List<String> listeners, FlightData data) {
if (rocket == null)
throw new IllegalArgumentException("options cannot be null");
this.rocket = rocket;
- this.document = doc;
if (status == Status.UPTODATE) {
this.status = Status.LOADED;
}
- /*
- * Return the parent document for this simulation
- */
- public OpenRocketDocument getDocument(){
- return document;
- }
-
/**
* Return the rocket associated with this simulation.
*
public Simulation duplicateSimulation(Rocket newRocket) {
mutex.lock("duplicateSimulation");
try {
- Simulation copy = new Simulation(document, newRocket);
+ Simulation copy = new Simulation(newRocket);
copy.name = this.name;
copy.options.copyFrom(this.options);