Пример #1
0
 public void ConstructLair(LairBase lairBase)
 {
     lairBase.origin = this.entityBase.origin;
     lairBase.food = 0;
     lairBase.eggs = lairBase.eggStockSize;
     EntityManager.Singleton.entityList.Add(lairBase);
     this.entityBase.isVisible = false;
 }
Пример #2
0
 public void StoreFood(LairBase lairBase)
 {
     if (entityBase.entityType == EntityType.Ant)
     {
         AntBase antBase = (AntBase)entityBase;
         if(lairBase.food < lairBase.foodStockSize)
         {
             int remainingStockSize = lairBase.foodStockSize - lairBase.food;
             if(antBase.capacity <= remainingStockSize)
             {
                 lairBase.food += antBase.capacity;
                 antBase.capacity -= antBase.capacity;
             }
             else
             {
                 lairBase.food += remainingStockSize;
                 antBase.capacity -= remainingStockSize;
             }
         }
     }
 }
Пример #3
0
        public void spawnLair(LairBase lairBase)
        {
            if (antWorld == null)
                throw new NullReferenceException("[antWorld] has not been initialized, yet.");

            int max_x = (int)antWorld.size.X;
            int max_y = (int)antWorld.size.Y;

            int random_x = Randomizer.NextInt(0, max_x);
            int random_y = Randomizer.NextInt(0, max_y);

            lairBase.position = new Vector2(random_x, random_y);

            EntityManager.Singleton.entityList.Add(lairBase);
        }