Ejemplo n.º 1
0
        //open new game window
        private void StartNewgameWindow(ThirdPlayerLocation location, PersonalizedForSpecificPlayerStartGameDataRequest data)
        {
            Windows.GameWindow gameWindow = new Windows.GameWindow(location, data, SavedDataPlaceholder.CardsBackColor)
            {
                Owner = this,
            };

            gameWindow.WindowWasClosedByUser  += GameWindow_WindowWasClosedByUser;
            gameWindow.GameWindowClosedByHost += GameWindow_GameWindowClosedByHost;
            gameWindow.ShowDialog();
            MemoryManagement.FlushMemory();
        }
Ejemplo n.º 2
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            List <PlayingCard> cardsList = new List <PlayingCard>
            {
                new PlayingCard(CardSuits.None, CardRanks.Joker, 1),
                new PlayingCard(CardSuits.Diamond, CardRanks.Seven, 1),
                new PlayingCard(CardSuits.Spade, CardRanks.Seven, 1),
                new PlayingCard(CardSuits.Heart, CardRanks.Ace, 1),
                new PlayingCard(CardSuits.Heart, CardRanks.Jack, 1),
            };

            ThisPlayerData thisPlayerData = new ThisPlayerData
            {
                ThisPlayerID     = "dwefkwbfwhbfwhbfb",
                ThisPlayerName   = "Michał",
                ThisPlayerNumber = 0,
                ThisPlayerCards  = cardsList
            };

            List <OtherPlayerData> otherPlayerData = new List <OtherPlayerData>();

            OtherPlayerData opd1 = new OtherPlayerData
            {
                OtherPlayerAmountOfCards = 5,
                OtherPlayerID            = "fwefergergerg",
                OtherPlayerName          = "Marek",
                OtherPlayerNumber        = 1,
            };

            OtherPlayerData opd2 = new OtherPlayerData
            {
                OtherPlayerAmountOfCards = 4,
                OtherPlayerID            = "ffvebtnyukio.io.u,",
                OtherPlayerName          = "Gosia",
                OtherPlayerNumber        = 2,
            };

            OtherPlayerData opd3 = new OtherPlayerData
            {
                OtherPlayerAmountOfCards = 6,
                OtherPlayerID            = "fwewevrtntyyu",
                OtherPlayerName          = "Basia",
                OtherPlayerNumber        = 3,
            };

            otherPlayerData.Add(opd1);
            otherPlayerData.Add(opd2);
            otherPlayerData.Add(opd3);

            GameStateData gameData = new GameStateData()
            {
                AmountOfPausingTurns                  = 0,
                CurrentlyDemandedRank                 = CardRanks.None,
                CurrentlyDemandedSuit                 = CardSuits.None,
                CurrentPlayerNumber                   = 0,
                AmountOfCardsToTakeIfLostBattle       = 0,
                BlockPossibilityOfTakingCardsFromDeck = false,
            };


            PersonalizedForSpecificPlayerStartGameDataRequest data = new PersonalizedForSpecificPlayerStartGameDataRequest
            {
                MinimumPlayerNumber   = 0,
                MaximumPlayerNumber   = 3,
                AmountOfPlayers       = 4,
                CurrentGameStatusData = gameData,
                PlayerID = "dwefkwbfwhbfwhbfb",
                NewCardsOnTheTableList = new List <PlayingCard> {
                    new PlayingCard(CardSuits.Heart, CardRanks.Seven, 1)
                },
                AmountOfCardsInDeck = 58,
                CurrentPlayerNumber = 0,
                DataOfThisPlayer    = thisPlayerData,
                DataOfOtherPlayers  = otherPlayerData
            };

            Windows.GameWindow gameWindow = new Windows.GameWindow(ThirdPlayerLocation.Left, data, CardGraphicsLibraryHandler.BackColor.Blue)
            {
                Owner = this,
            };
            gameWindow.ShowDialog();
        }