/// <summary> /// Initializes the whole page. Called before the node is added to the tree by the lesson controller. /// </summary> public override void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _topTrafficLight = GetNode <TrafficControlSystem>("Signalisation/TrafficControlSystemTop"); _topTrafficLight.SetToGreen(SimulationInput.PollBoolean(_topTrafficLightKey)); _botTrafficLight = GetNode <TrafficControlSystem>("Signalisation/TrafficControlSystemBot"); _botTrafficLight.SetToGreen(SimulationInput.PollBoolean(_botTrafficLightKey)); PathController topPath = GetNode <PathController>("DynamicCars/TopPath"); topPath.Setup(_topTrafficLight); PathController botPath = GetNode <PathController>("DynamicCars/BotPath"); botPath.Setup(_botTrafficLight); _trafficController = new TrafficController(topPath, botPath); SpawnTimeGenerator.ResetGenerator(); }
/// <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 <RoadConstructionSite>("PlantViewportContainer/PlantViewport/RoadConstructionSite"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } if (_simulationMaster == null || !_isExecutable) { _isExecutable = false; _testState = TestState.Done; _openedLesson.SetAndSaveStars(0); } SpawnTimeGenerator.ResetGenerator(); }