public void BuildHouseInterface(IPlayer player) { Land land = ChooseLandToBuildOn(player); if (land != null && GetBuildHouseHereConfirmation(land)) { if (player.Money >= land.HousePrice) { land.BuildHouse(); } else { DisplayMessage("Sorry, you don't have enough money."); } } }
/// <summary> /// Ask the player if he wants to build a house on the land /// </summary> /// <param name="land"></param> /// <returns> A boolean representing the response of the player</returns> public bool GetBuildHouseHereConfirmation(Land land) { return(UserInteraction.GetConfirmation($"Do you want to build a house on {land} for {land.HousePrice}$ ?")); }