internal void Setup(RTSAgent agent, int id)
 {
     System.Type mainType = this.GetType();
     if (mainType.IsSubclassOf(typeof(ActiveAbility)))
     {
         while (mainType.BaseType != typeof(ActiveAbility) &&
                mainType.GetCustomAttributes(typeof(CustomActiveAbilityAttribute), false).Length == 0)
         {
             mainType = mainType.BaseType;
         }
         Data = AbilityDataItem.FindInterfacer(mainType);
         if (Data == null)
         {
             throw new System.ArgumentException("The Ability of type " + mainType + " has not been registered in database");
         }
         this.MyAbilityCode = Data.Name;
     }
     else
     {
         this.MyAbilityCode = mainType.Name;
     }
     _agent = agent;
     ID     = id;
     TemplateSetup();
     OnSetup();
     this.VariableContainerTicket = LSVariableManager.Register(this);
     this._variableContainer      = LSVariableManager.GetContainer(VariableContainerTicket);
 }
示例#2
0
 private void RegisterLockstep()
 {
     TrackedLockstepTickets.Add(LSVariableManager.Register(this.Body));
     foreach (Ability abil in this.abilityManager.Abilitys)
     {
         TrackedLockstepTickets.Add(LSVariableManager.Register(abil));
     }
 }