private CitySlot(int id, Vector3 pos) { slotID = id; position = pos; occupant = null; hasOccupant = false; }
public bool SetOccupant(BO_Static newOcc) { if (IsAvailable) { if (freeSlotList.Remove(this)) { availableSlots--; } else { Debug.LogError("available slot desync?"); } hasOccupant = true; occupant = newOcc; if (!TypeAdd(this)) { Debug.LogError("type lookup dict desync?"); } occupant.AssignCitySlot(this); return(true); } return(false); }
public bool EmptyOccupant() { if (!IsAvailable) { if (!freeSlotList.Contains(this)) { freeSlotList.Add(this); availableSlots++; } else { Debug.LogError("available slot desync?"); } if (!TypeRemove(this)) { Debug.LogError("type lookup dict desync?"); } hasOccupant = false; occupant = null; return(true); } return(false); }