Selaa lähdekoodia

Adds direct model access to the controller (but better use controller)

Andreas T. Meyer-Berg 6 vuotta sitten
vanhempi
commit
b3c2dc2064

+ 10 - 1
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/control/Controller.java

@@ -13,7 +13,7 @@ public class Controller {
 	/**
 	 * {@link Model} which stores the smart home model
 	 */
-	Model model;
+	private Model model;
 	
 	/**
 	 * Controller for Import of user defined java classes
@@ -50,6 +50,15 @@ public class Controller {
 		simulationController = new SimulationController(this.model, this);
 	}
 	
+	/**
+	 * Returns the main model of the simulation, use with precaution. Calls via the controller are preferred
+	 * @return Main Model for full access to the model
+	 * @deprecated use the corresponding controller 
+	 */
+	public Model getModel(){
+		return model;
+	}
+	
 	/**
 	 * Returns the ImportController, which manages the user imported classes, 
 	 * which can be used in the framework