Beispiel #1
0
 public void CalculateNextStep(CircularSawModel master, int deltaTime)
 {
     MotorSwitchedOn = master.SimulationInput.PollBoolean(MotorKey);
     PushValue(MotorSwitchedOn);
     if (MotorSwitchedOn && !Broken)
     {
         _blade.RotateX(0.02f * deltaTime);
         CheckFlicker();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Initializes the whole twat viewer. Called before the node is added to the tree by the lesson controller.
 /// </summary>
 public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson)
 {
     _openedLesson    = openedLesson;
     Simulation       = GetNode <CircularSawModel>("ViewportContainer/Viewport/CircularSawModel");
     SimulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, Simulation);
     if (SimulationMaster != null)
     {
         Simulation.InitialiseWith(mainNode, openedLesson);
         _isExecutable = SimulationMaster.IsProgramSimulationValid();
         SetupTestSteps();
     }
     else
     {
         _isExecutable = false;
     }
 }