Exemple #1
0
 public void ForceUpdate(GameTime gameTime)
 {
     foreach (Script script in this.levelScripts)
     {
         if (script.ScheduleEvalulation)
         {
             this.ProcessTrigger((ScriptTrigger)ScriptingHost.NullTrigger.Instance, script);
             script.ScheduleEvalulation = false;
         }
     }
     for (int index = this.activeScripts.Count - 1; index != -1; --index)
     {
         ActiveScript activeScript = this.activeScripts[index];
         this.EvaluatedScript = activeScript;
         activeScript.Update(gameTime.ElapsedGameTime);
         if (activeScript.IsDisposed && this.activeScripts.Count > 0 && this.activeScripts[index] == activeScript)
         {
             this.activeScripts.RemoveAt(index);
             if (activeScript.Script.OneTime)
             {
                 activeScript.Script.Disabled = true;
                 if (!activeScript.Script.LevelWideOneTime)
                 {
                     this.GameState.SaveData.ThisLevel.InactiveEvents.Add(activeScript.Script.Id);
                 }
                 this.GameState.Save();
             }
         }
     }
     this.EvaluatedScript = (ActiveScript)null;
 }
Exemple #2
0
        private static void ProcessEndTrigger(ScriptTrigger trigger, ActiveScript script, int?id)
        {
            int?nullable   = id;
            int?identifier = trigger.Object.Identifier;

            if ((nullable.GetValueOrDefault() != identifier.GetValueOrDefault() ? 0 : (nullable.HasValue == identifier.HasValue ? 1 : 0)) == 0)
            {
                return;
            }
            script.Dispose();
        }
Exemple #3
0
 private static void ProcessEndTrigger(ScriptTrigger trigger, ActiveScript script, int? id)
 {
   int? nullable = id;
   int? identifier = trigger.Object.Identifier;
   if ((nullable.GetValueOrDefault() != identifier.GetValueOrDefault() ? 0 : (nullable.HasValue == identifier.HasValue ? 1 : 0)) == 0)
     return;
   script.Dispose();
 }
Exemple #4
0
 private static void ProcessEndTrigger(ScriptTrigger trigger, ActiveScript script)
 {
   ScriptingHost.ProcessEndTrigger(trigger, script, new int?());
 }
Exemple #5
0
 private static void ProcessEndTrigger(ScriptTrigger trigger, ActiveScript script)
 {
     ScriptingHost.ProcessEndTrigger(trigger, script, new int?());
 }