Exemplo n.º 1
0
 internal override void Update(STFReader stf)
 {
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("id", () => { ID = stf.ReadIntBlock(null); }),
         new STFReader.TokenProcessor("activation_level", () => { ActivationLevel = stf.ReadIntBlock(null); }),
         new STFReader.TokenProcessor("outcomes", () =>
         {
             if (Outcomes == null)
             {
                 Outcomes = new Outcomes(stf);
             }
             else
             {
                 Outcomes.Update(stf);
             }
         }),
         new STFReader.TokenProcessor("texttodisplayoncompletioniftriggered", () => { TextToDisplayOnCompletionIfTriggered = stf.ReadStringBlock(""); }),
         new STFReader.TokenProcessor("texttodisplayoncompletionifnotriggered", () => { TextToDisplayOnCompletionIfNotTriggered = stf.ReadStringBlock(""); }),
         new STFReader.TokenProcessor("name", () => { Name = stf.ReadStringBlock(""); }),
         new STFReader.TokenProcessor("time", () => { Time = (int)stf.ReadFloatBlock(STFReader.Units.Time, null); }),
         new STFReader.TokenProcessor("ortscontinue", () => { OrtsContinue = stf.ReadIntBlock(0); }),
         new STFReader.TokenProcessor("ortsactsoundfile", () => OrtsActivitySoundProcessor(stf)),
         new STFReader.TokenProcessor("ortsweatherchange", () => { WeatherChange = new OrtsWeatherChange(stf); }),
     });
 }
Exemplo n.º 2
0
 internal override void Update(STFReader stf)
 {
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("eventtypelocation", () => { stf.MustMatchBlockStart(); stf.MustMatchBlockEnd(); }),
         new STFReader.TokenProcessor("id", () => { ID = stf.ReadIntBlock(null); }),
         new STFReader.TokenProcessor("ortstriggeringtrain", () => { ParseTrain(stf); }),
         new STFReader.TokenProcessor("activation_level", () => { ActivationLevel = stf.ReadIntBlock(null); }),
         new STFReader.TokenProcessor("outcomes", () =>
         {
             if (Outcomes == null)
             {
                 Outcomes = new Outcomes(stf);
             }
             else
             {
                 Outcomes.Update(stf);
             }
         }),
         new STFReader.TokenProcessor("name", () => { Name = stf.ReadStringBlock(null); }),
         new STFReader.TokenProcessor("texttodisplayoncompletioniftriggered", () => { TextToDisplayOnCompletionIfTriggered = stf.ReadStringBlock(null); }),
         new STFReader.TokenProcessor("texttodisplayoncompletionifnottriggered", () => { TextToDisplayOnCompletionIfNotTriggered = stf.ReadStringBlock(null); }),
         new STFReader.TokenProcessor("triggeronstop", () => { TriggerOnStop = stf.ReadBoolBlock(true); }),
         new STFReader.TokenProcessor("location", () => {
             stf.MustMatchBlockStart();
             location = new WorldLocation(stf.ReadInt(null), stf.ReadInt(null),
                                          stf.ReadFloat(STFReader.Units.None, null), 0f, stf.ReadFloat(STFReader.Units.None, null));
             RadiusM = stf.ReadFloat(STFReader.Units.Distance, null);
             stf.MustMatchBlockEnd();
         }),
         new STFReader.TokenProcessor("ortscontinue", () => { OrtsContinue = stf.ReadIntBlock(0); }),
         new STFReader.TokenProcessor("ortsactsoundfile", () => OrtsActivitySoundProcessor(stf)),
         new STFReader.TokenProcessor("ortsweatherchange", () => { WeatherChange = new OrtsWeatherChange(stf); }),
     });
 }
Exemplo n.º 3
0
 internal void Update(STFReader stf)
 {
     stf.MustMatchBlockStart();
     stf.ParseBlock(new STFReader.TokenProcessor[] {
         new STFReader.TokenProcessor("activitysuccess", () => { stf.MustMatchBlockStart(); stf.MustMatchBlockEnd(); ActivitySuccess = true; }),
         new STFReader.TokenProcessor("activityfail", () => { ActivityFail = stf.ReadStringBlock(""); }),
         new STFReader.TokenProcessor("activateevent", () => { ActivateList.Add(stf.ReadIntBlock(null)); }),
         new STFReader.TokenProcessor("restoreactlevel", () => { RestoreActivityLevels.Add(stf.ReadIntBlock(null)); }),
         new STFReader.TokenProcessor("decactlevel", () => { DecrementActivityLevels.Add(stf.ReadIntBlock(null)); }),
         new STFReader.TokenProcessor("incactlevel", () => { IncrementActivityLevels.Add(stf.ReadIntBlock(null)); }),
         new STFReader.TokenProcessor("displaymessage", () => {
             DisplayMessage = stf.ReadStringBlock("");
         }),
         new STFReader.TokenProcessor("ortsrestartwaitingtrain", () => { RestartWaitingTrain = new RestartWaitingTrain(stf); }),
         new STFReader.TokenProcessor("ortsweatherchange", () => { WeatherChange = new OrtsWeatherChange(stf); }),
         new STFReader.TokenProcessor("ortsactivitysound", () => { ActivitySound = new ActivitySound(stf); }),
     });
 }