Exemplo n.º 1
0
 public static void Initialize()
 {
     Array.Clear(ActiveGroups, 0, ActiveGroups.Length);
     ActiveGroupPeakCount = 0;
     ActiveGroupOpenSlots.FastClear();
     InactiveGroups.FastClear();
 }
 public static void Initialize()
 {
     InstanceManagers.Clear();
     GlobalAgentActive.Clear();
     OpenGlobalIDs.FastClear();
     PeakGlobalID = 0;
     foreach (FastStack <RTSAgent> cache in CachedAgents.Values)
     {
         for (int j = 0; j < cache.Count; j++)
         {
             cache.innerArray[j].SessionReset();
         }
     }
 }
Exemplo n.º 3
0
        static void ResetVars()
        {
            for (int i = 0; i < PeakCount; i++)
            {
                SimObjects[i] = null;
            }
            DynamicSimObjects.FastClear();
            Raycaster._Version = 0;
            PeakCount          = 0;
            CachedIDs.FastClear();

            CollisionPair.CurrentCollisionPair = null;
            PeakCount        = 0;
            AssimilatedCount = 0;

            Partition.Initialize();
            RanCollisionPairs.FastClear();
            InactiveCollisionPairs.FastClear();

            _positionCycler = 0;
        }
        private AgentController(AllegianceType defaultAllegiance, string controllerName)
        {
            if (InstanceManagers.Count > byte.MaxValue)
            {
                throw new System.Exception("Cannot have more than 256 AgentControllers");
            }
            OpenLocalIDs.FastClear();
            PeakLocalID       = 0;
            ControllerID      = (byte)InstanceManagers.Count;
            ControllerName    = controllerName;
            DefaultAllegiance = defaultAllegiance;

            for (int i = 0; i < InstanceManagers.Count; i++)
            {
                this.SetAllegiance(InstanceManagers[i], AllegianceType.Neutral);
            }

            InstanceManagers.Add(this);
            UpdateDiplomacy(this);
            this.SetAllegiance(this, AllegianceType.Friendly);
        }