/// <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) { _simulation = GetNode <MinimalSimulationExample>("MinimalSimulationExample"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } else { _isExecutable = false; } }
/// <summary> /// Initializes the whole test viewer. Called before the node is added to the tree by the lesson controller. /// </summary> public void InitialiseWith(IMainNode mainNode, ILessonEntity openedLesson) { _simulation = GetNode <ElectricalBarrier>("Viewport/ElectricalBarrier"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } else { _isExecutable = false; Result = 0; GetNode <Label>("Label").Text = "Program can not be executed"; } }
/// <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(); }
/// <summary> /// Initializes the whole test 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 <Lights>("Lights"); _simulationMaster = DiagramSimulationLoader.LoadTemp(openedLesson, _simulation); if (_simulationMaster != null) { _simulation.InitialiseWith(mainNode, openedLesson); _isExecutable = _simulationMaster.IsProgramSimulationValid(); } else { _isExecutable = false; } if (!_isExecutable) { _stage = Stages.CreateResult; } }