コード例 #1
0
ファイル: Tower.cs プロジェクト: steffan88/Bevelle
        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");
        }
コード例 #2
0
ファイル: Tower.cs プロジェクト: steffan88/Bevelle
 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");
 }