internal void SetOccupant(ILocationOccupant occupant) { if (!(this.Occupant is EmptyLocation)) { throw new Exception("can't place over existing occupant"); } Occupant = occupant; Occupant.Location = this; }
public Location(string name, ILocationOccupant occupant) { Name = name; Occupant = occupant; occupant.Location = this; }