StarSystem.UpdateSuspendedRules C# (CSharp) Method

UpdateSuspendedRules() public method

public UpdateSuspendedRules ( float dt, World, world, List toRemove, RuleTable, ActiveRules ) : void
dt float
world World,
toRemove List
ActiveRules RuleTable,
return void
  public void UpdateSuspendedRules(float dt, World world, List<int> toRemove, RuleTable ActiveRules)
  {
    if (ActiveRules.ActiveIndices.Top > 0 && frame == World.frame)
    {
      for (int i = 0; i < ActiveRules.ActiveIndices.Top; i++)
      {
        var x = ActiveRules.ActiveIndices.Elements[i];
        switch (x)
        {
          case 1:
            if (this.Rule1(dt, world) == RuleResult.Done)
            {
              ActiveRules.ActiveSlots[i] = false;
              ActiveRules.ActiveIndices.Top--;
            }
            else
            {
              ActiveRules.SupportSlots[1] = true;
              ActiveRules.SupportStack.Push(x);
            }
            break;

          default:
            break;
        }
      }
      ActiveRules.ActiveIndices.Clear();
      ActiveRules.Clear();

      var tmp = ActiveRules.SupportStack;
      var tmp1 = ActiveRules.SupportSlots;

      ActiveRules.SupportStack = ActiveRules.ActiveIndices;
      ActiveRules.SupportSlots = ActiveRules.ActiveSlots;


      ActiveRules.ActiveIndices = tmp;
      ActiveRules.ActiveSlots = tmp1;

      if (ActiveRules.ActiveIndices.Top == 0)
        toRemove.Add(ID);
    }
    else
    {
      if (this.frame != World.frame)
        toRemove.Add(ID);
    }
  }