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"); }
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"); }