public void StepSimulation(SimulationTime deltaTime, SimulationCommand[] commands) { //Run precomponents of all commands for (int i = 0; i < commands.Length; i++) { commands[i].PreComponentCalcuation(this.Scene, deltaTime); } this.Scene.RunComponents(); //Run precomponents of all commands for (int i = 0; i < commands.Length; i++) { commands[i].PostComponentCalculation(this.Scene, deltaTime); } }
private void Update(long deltaTime) { //Debug.WriteLine("Updating"); //Get the commands SimulationCommand[] commands = new SimulationCommand[0]; if(this.nextStepCommands != null) { commands = this.nextStepCommands.ToArray(); } Simulation.StepSimulation(new SimulationTime(), commands); //The simulation is complete this.Messenger.Publish(new SimulationFrameComplete(Simulation.latestDataSet)); }