public void SwitchCabin(Cabin cabin) { var element = new XElement(cabin.Element); var x = TileX; var y = TileY; TileX = x; TileY = y; cabin.UpdateFarmhand(Farmhand); Element.ReplaceAll(cabin.Element.Nodes()); }
public Cabin CreateNewCabin(Cabin cabin) { cabin.UpdateFarmhand(Host); UpdateHost(); var moved = MoveToValidLocation(cabin); if (moved) { Farm.Element("buildings").Add(cabin.Element); return(cabin); } return(null); }