Esempio n. 1
0
 /// <summary>
 /// A player loses a street card.
 /// </summary>
 /// <param name="player">The losing player</param>
 /// <param name="gameCard">The street card</param>
 public void PlayerRemoveGameCard(GameCardViewModel gameCard)
 {
     OwnedStreets[gameCard.OwnerArrayID]   = null;
     OwnedStreetIDs[gameCard.OwnerArrayID] = false;
     gameCard.OwningPlayer = null;
     PlayerSetMonopolies();
 }
Esempio n. 2
0
 /// <summary>
 /// A player receives a street card.
 /// </summary>
 /// <param name="player">The receiving player</param>
 /// <param name="gameCard">The street card</param>
 public void PlayerAddGameCard(GameCardViewModel gameCard)
 {
     OwnedStreets[gameCard.OwnerArrayID]   = gameCard;
     OwnedStreetIDs[gameCard.OwnerArrayID] = true;
     PlayerSetMonopolies();
     gameCard.OwningPlayer = this;
 }
Esempio n. 3
0
 public void OpenStreetBuyingWindow(PlayerViewModel player, GameCardViewModel gameCard)
 {
     SetStreetBuyingGameCard(gameCard);
     SetEnableBuying(player.PlayerCheckBalance(gameCard.StreetPrice));
     SetCashAfterBuying(player.PlayerCashAfterBuying(gameCard));
     WindowContent.GetWindowContent().GetAdditionalViewModel <DoneButtonViewModel>().SetDoneButton(false);
     WindowContent.GetWindowContent().SetDetailsViewModelActive <StreetBuyingViewModel>();
 }
Esempio n. 4
0
 /// <summary>
 /// A street card is being moved from one player to another.
 /// </summary>
 /// <param name="receivingPlayer">The receiving player</param>
 /// <param name="givingPlayer">The giving player</param>
 /// <param name="gameCard">The street card</param>
 public void MoveGameCardToAnotherPlayer(PlayerViewModel receivingPlayer, GameCardViewModel gameCard)
 {
     receivingPlayer.OwnedStreets[gameCard.OwnerArrayID] = gameCard;
     gameCard.OwningPlayer = receivingPlayer;
     OwnedStreets[gameCard.OwnerArrayID]   = null;
     OwnedStreetIDs[gameCard.OwnerArrayID] = false;
     receivingPlayer.OwnedStreetIDs[gameCard.OwnerArrayID] = true;
     PlayerSetMonopolies();
 }
Esempio n. 5
0
        /// <summary>
        /// One array and 4 observable collections will be created.
        /// The array of gamecards correlate to every street on the game board.
        /// The other 4 collections are created for the visual representation of the board and keep references to the objects inside the first array.
        /// These 4 observable collections are the binding source for the UI.
        /// </summary>
        public void InitializeArray()
        {
            GameCards = new GameCardViewModel[]
            {
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.LOS)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Badstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Gemeinschaftsfeld)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Turmstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Einkommenssteuer)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Südbahnhof)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Chausseestraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Ereignisfeld)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Elisenstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Poststraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Gefängnis)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Seestraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.EWerk)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Hafenstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.NeueStraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Westbahnhof)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.MünchnerStraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Gemeinschaftsfeld)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.WienerStraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.BerlinerStraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.FreiParken)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.TheaterStraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Ereignisfeld)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Museumstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Opernplatz)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.NordBahnhof)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Lessingstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Schillerstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Wasserwerk)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Goethestraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.InDasGefängnis)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Rathausplatz)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Hauptstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Gemeinschaftsfeld)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Bahnhofstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Hauptbahnhof)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Ereignisfeld)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Parkstraße)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Zusatzsteuer)),
                new GameCardViewModel(SetEnums.SetGameCard(Utility.StreetName.Schlossallee))
            };
            GameCards1 = new ObservableCollection <GameCardViewModel>();
            GameCards2 = new ObservableCollection <GameCardViewModel>();
            GameCards3 = new ObservableCollection <GameCardViewModel>();
            GameCards4 = new ObservableCollection <GameCardViewModel>();

            GameCards1 = TransferArrayToCollection(GameCards, 11, 0);
            GameCards2 = TransferArrayToCollectionReverse(GameCards, 9, 11);
            GameCards3 = TransferArrayToCollection(GameCards, 11, 20);
            GameCards4 = TransferArrayToCollection(GameCards, 9, 31);
        }
Esempio n. 6
0
 public bool IsMonopolyComplete(GameCardViewModel gameCard)
 {
     if (Monopolies[gameCard.MonopoliesID])
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Returns the amount of cash a player has after a potetial selling action.
 /// </summary>
 /// <param name="streetPrice"></param>
 /// <returns></returns>
 public int PlayerCashAfterTakingMortgage(GameCardViewModel streetPrice)
 {
     return(PlayerCash + streetPrice.Mortgage[0]);
 }
Esempio n. 8
0
 /// <summary>
 /// Returns the amount of cash a player has after a potetial buying action.
 /// </summary>
 /// <param name="streetPrice"></param>
 /// <returns></returns>
 public int PlayerCashAfterPayingMortgage(GameCardViewModel streetPrice)
 {
     return(PlayerCash - streetPrice.Mortgage[1]);
 }
Esempio n. 9
0
 /// <summary>
 /// Returns the amount of cash a player has after a potetial selling action.
 /// </summary>
 /// <param name="streetPrice"></param>
 /// <returns></returns>
 public int PlayerCashAfterSellingHouse(GameCardViewModel streetPrice)
 {
     return(PlayerCash + streetPrice.HousePrice / 2);
 }
Esempio n. 10
0
 /// <summary>
 /// Returns the amount of cash a player has after a potetial buying action.
 /// </summary>
 /// <param name="streetPrice"></param>
 /// <returns></returns>
 public int PlayerCashAfterBuildingHouse(GameCardViewModel streetPrice)
 {
     return(PlayerCash - streetPrice.HousePrice);
 }
Esempio n. 11
0
 /// <summary>
 /// Returns the amount of cash a player has after a potetial buying action.
 /// </summary>
 /// <param name="streetPrice"></param>
 /// <returns></returns>
 public int PlayerCashAfterBuying(GameCardViewModel streetPrice)
 {
     return(PlayerCash - streetPrice.StreetPrice);
 }
Esempio n. 12
0
 public void SetStreetBuyingGameCard(GameCardViewModel gameCard)
 {
     GameCard = gameCard;
 }