Esempio n. 1
0
        protected virtual void OnGameStarted()
        {
            gameDataManager = new GameDataManager(localPlayer, remotePlayer);
            gameDataManager.Shuffle();

            //PLAY SOUND
            audioData.PlayOneShot(shuffleClip);
            //audioData.clip = shuffleClip;
            //audioData.loop = true;
            //audioData.Play();

            for (int i = 0; i < 3; i++)
            {
                byte bookRankP1 = gameDataManager.DrawCardValue();
                byte bookRankP2 = gameDataManager.DrawCardValue();

                //cardAnimator.DealBooks(localPlayer, bookRankP1);
                //cardAnimator.DealBooks(remotePlayer, bookRankP2);

                remotePlayer.CreateBottomBook(bookRankP1, cardAnimator, i);
                localPlayer.CreateBottomBook(bookRankP2, cardAnimator, i);

                gameDataManager.AddBottomBooksForPlayer(localPlayer, Card.GetRank(bookRankP1));
                gameDataManager.AddBottomBooksForPlayer(remotePlayer, Card.GetRank(bookRankP2));
            }

            for (int i = 0; i < 3; i++)
            {
                byte bookRankP1 = gameDataManager.DrawCardValue();
                byte bookRankP2 = gameDataManager.DrawCardValue();

                remotePlayer.CreateTopBook(bookRankP1, cardAnimator, i);
                localPlayer.CreateTopBook(bookRankP2, cardAnimator, i);

                //localPlayer.ReceiveBook(bookRankP1, cardAnimator);

                gameDataManager.AddBooksForPlayer(localPlayer, Card.GetRank(bookRankP1));
                gameDataManager.AddBooksForPlayer(remotePlayer, Card.GetRank(bookRankP2));
            }

            for (int i = 0; i < 3; i++)
            {
                gameDataManager.DealCardValuesToPlayer(localPlayer, PLAYER_INITIAL_2_CARDS);
                gameDataManager.DealCardValuesToPlayer(remotePlayer, PLAYER_INITIAL_2_CARDS);

                cardAnimator.DealDisplayingCards(localPlayer, PLAYER_INITIAL_2_CARDS);
                cardAnimator.DealDisplayingCards(remotePlayer, PLAYER_INITIAL_2_CARDS);
            }


            //audioData.loop = false;
            //audioData.Stop();

            gameState = GameState.TurnStarted;
        }