/// <summary> /// Display the properties of the player /// </summary> /// <param name="player"></param> public void DisplayProperties(IPlayer player) { IList <Property> properties = player.OwnedProperties; if (properties != null && properties.Count > 0) { UserInteraction.DisplayObjectList <Property>("Here is the list of your properties :", player.OwnedProperties); } else { DisplayMessage("You have no properties."); } }
/// <summary> /// Ask the player where he wants to build his house /// </summary> /// <param name="player"></param> /// <returns> The land where the player wants to build his house </returns> public Land ChooseLandToBuildOn(IPlayer player) { IList <Land> buildableOwnedLands = player.BuildableOwnedLands; if (buildableOwnedLands.Count == 0) { DisplayMessage("There is no land you can build a house on."); return(null); } else { return(UserInteraction.GetObjectChoice <Land>("Where do you want to build your house ?", buildableOwnedLands)); } }
/// <summary> /// Ask the player if he wants to sell the property /// </summary> /// <param name="property"></param> /// <returns> A boolean representing the response of the player</returns> public bool GetSaleConfirmation(Property propertyToSell, int priceToSellFor, IPlayer playerToSellTo) { return(UserInteraction.GetConfirmation($"Do you want to sell {propertyToSell} for {priceToSellFor}$ to {playerToSellTo} ?")); }
/// <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}$ ?")); }
public int GetEnteredInt(string message = null) { return(Convert.ToInt32(UserInteraction.GetEnteredDouble(message))); }
public T GetObjectChoice <T>(string message, IList <T> choicesList, IList <string> choicesTitlesList = null) { return(UserInteraction.GetObjectChoice <T>(message, choicesList, choicesTitlesList)); }
/// <summary> /// Ask the player if he wants to buy the property /// </summary> /// <param name="property"></param> /// <returns> A boolean representing the response of the player</returns> public bool GetPurchaseConfirmation(Property propertyToBuy, int PriceToBuyFor, IPlayer playerToBuyFrom) { return(UserInteraction.GetConfirmation($"Do you want to buy {propertyToBuy} for {PriceToBuyFor}$ ?")); }
public string GetEnteredString(string message) { return(UserInteraction.GetEnteredString(message)); }
public bool GetConfirmation(string message = "Do you want to continue ?") { return(UserInteraction.GetConfirmation(message)); }