Ejemplo n.º 1
0
        public void LeaveTower(Dwarf d)
        {
            d.SetTowerSlot(null);
            foreach (TowerSlot ds in _towerSlots)
            {
                if (ds.D == null)
                    continue;

                if (ds.D.Id == d.Id)
                {
                    ds.D = null;
                    return;
                }
            }

            throw new Exception("Dwarf tried to leave tower, but has already left");
        }
Ejemplo n.º 2
0
 public TowerSlot GoInto(Dwarf d)
 {
     foreach (TowerSlot ds in _towerSlots)
     {
         if (ds.D == null)
         {
             ds.D = d;
             d.SetTowerSlot(ds);
             return ds;
         }
     }
     throw new Exception("No slot open");
 }