// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. //============================================================================= // GeoGameInfo // // Game start for normal gameplay // // ------------------------------------------------------------ // Created by Rui Guimaraes // © 2006, Geodelft // // Date Id Modification // 2006-03-20 gui Class created //============================================================================= class GeoGameInfoMiniGames extends GeoGameInfo; //============================================================================= // Description: PostNetBeginPlay; Should it be PostBeginPlay or PostNetBeginPlay? // // Date Id Modification // 2006-03-20 gui Created //============================================================================= event PostNetBeginPlay() { local int i; local GeoLevelDetails GLD; log("x x x x x x x x x x x x sdfGeoGameInfoMiniGames"); GLD = new class'GeoLevelDetails'; GLD.ResetLevelDetails(); GLD.IsRaining = true; GLD.MakeDiagnoses = false; GLD.TakeMeasures = false; GLD.IsCompleteExercise = false; GLD.ArrayCriticalActiveFailureNames.Insert(0,1); log("levelTITLE"); log("levelTITLE:"@level.title); if(level.title =="MiniGame Macro") { // GLD.ArrayCriticalActiveFailureNames[0] = 'Failure6'; GLD.CurrentLevelScenarioNumber = 2; log("x x x x x x x x x x x x starting macro"); }else if(level.title =="MiniGame Micro") { // GLD.ArrayCriticalActiveFailureNames[0] = 'Failure3'; GLD.CurrentLevelScenarioNumber = 2; }else if(level.title =="MiniGame Piping") { // GLD.ArrayCriticalActiveFailureNames[0] = 'Failure11'; GLD.CurrentLevelScenarioNumber =1 ; }else if(level.title =="MiniGame Overtopping") { // GLD.ArrayCriticalActiveFailureNames[0] = 'Failure4'; GLD.CurrentLevelScenarioNumber = 2; } GLD.ArrayRelevantActiveFailureNames.Length=0; GLD.ArrayReportableActiveFailureNames.Length=0; /// Find droogte keyword string: i = Instr(level.title, "Droogte"); if (i != -1) { // Always level 2: GLD.CurrentLevelScenarioNumber = 2; /// Always dry GLD.IsRaining = false; ReplaceTexturesOfMeshes(); } GLD.SaveConfig(); log("PostNetBeginPlay() geoGameInfoMiniGames"); Super.PostNetBeginPlay(); } //============================================================================= // Date Id Modification // 2006-10-09 the Created this header //============================================================================= function bool SetFailures() { // local Failure TempFailure; local LeveeTile A; local GeoLevelDetails GLD; local int i; local name TempName; local bool bIsActive; local LeveeTile TempTileFailure; local LeveeTile T; local GeoEnums.FailingMechanisms mechanism; GLD = new class'GeoLevelDetails'; Log("[GeoGameInfoTraining] SetFailures (training)"); /// Reset level data now: GLD.ResetLevelDetails(); /// Training level: GLD.CurrentLevelScenarioNumber = 0; /// Find tiles to immediatly activate: ForEach AllActors( class 'LeveeTile', T) { /// Activate directly if necessary: if (T.ConfiguredFailure != FM_None) { if (T.ConfiguredFailureState == STA_Reportable) { Log(T @ "Preconfigued as STA_Reportable"); GLD.ArrayReportableActiveFailureNames.Insert(0,1); GLD.ArrayReportableActiveFailureNames[0].FailureName = T.Name; GLD.ArrayReportableActiveFailureNames[0].MechanismType = T.ConfiguredFailure; } if (T.ConfiguredFailureState == STA_Relevant) { Log(T @ "Preconfigued as STA_Relevant"); GLD.ArrayRelevantActiveFailureNames.Insert(0,1); GLD.ArrayRelevantActiveFailureNames[0].FailureName = T.Name; GLD.ArrayRelevantActiveFailureNames[0].MechanismType = T.ConfiguredFailure; } if (T.ConfiguredFailureState == STA_Critical) { Log(T @ "Preconfigued as STA_Critical"); GLD.ArrayCriticalActiveFailureNames.Insert(0,1); GLD.ArrayCriticalActiveFailureNames[0].FailureName = T.Name; GLD.ArrayCriticalActiveFailureNames[0].MechanismType = T.ConfiguredFailure; } } } ForEach AllActors( class 'LeveeTile', A, ) { /// Only if not preconfigured bIsActive=false; TempTileFailure=(A); TempName=TempTileFailure.Name; Log("SetFailures() FailureName"$TempTileFailure.Name); for(i=0; i