Esempio n. 1
0
 //Used by AI to create the infection network.
 public void addTownToNetwork(ITownEntity town)
 {
     if (!_connectedTowns.Contains(town))
     {
         _connectedTowns.Add(town);
     }
 }
 public TownProperties(IEntity parent)
 {
     if (parent is ITownEntity)
     {
         _parent = (ITownEntity)parent;
     }
 }
        public void setTown()
        {
            List <ITownEntity> temp = _updatedTowns;

            for (int i = 0; i < temp.Count; i++)
            {
                if (temp[i].getTownComponent.getConnectedTowns.Count < 3)
                {
                    temp.RemoveAt(i);
                }
            }

            int index = Engine._random.Next(0, temp.Count);

            _startTown = temp[index];
            _startTown.getTownComponent.Infected = true;
            _startTown.getTownComponent.Active   = true;
            _infectedTowns.Add(_startTown);
        }