Exemplo n.º 1
0
        /// <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.");
            }
        }
Exemplo n.º 2
0
        /// <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));
            }
        }
Exemplo n.º 3
0
 /// <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} ?"));
 }
Exemplo n.º 4
0
 /// <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}$ ?"));
 }
Exemplo n.º 5
0
 public int GetEnteredInt(string message = null)
 {
     return(Convert.ToInt32(UserInteraction.GetEnteredDouble(message)));
 }
Exemplo n.º 6
0
 public T GetObjectChoice <T>(string message, IList <T> choicesList, IList <string> choicesTitlesList = null)
 {
     return(UserInteraction.GetObjectChoice <T>(message, choicesList, choicesTitlesList));
 }
Exemplo n.º 7
0
 /// <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}$ ?"));
 }
Exemplo n.º 8
0
 public string GetEnteredString(string message)
 {
     return(UserInteraction.GetEnteredString(message));
 }
Exemplo n.º 9
0
 public bool GetConfirmation(string message = "Do you want to continue ?")
 {
     return(UserInteraction.GetConfirmation(message));
 }