コード例 #1
0
 private void GameStart(GameStartResponse response)
 {
     _isOtherplayerDeclared      = false;
     groupValidationRequestCount = 0;
     _isPlayingGame   = true;
     _isPlayerDeclare = false;
     playerCards.Clear();
     playerCards   = response.playerCards;
     playerTurn    = response.playerTurn;
     remainingTime = response.remainingTime;
     wildCard      = response.wildCard;
     eventTime     = response.eventTime;
     UiManager.GetInstance.EnableGameplayScreen();
     OnGameStart?.Invoke(playerCards);
     discardedCard = response.discardPile;
     closedCard    = response.closedDeck;
     UiManager.GetInstance.StartTimer(playerTurn, remainingTime, OnTimerComplete);
     isCardDrawn = false;
     UiManager.GetInstance.DisableRoomJoinWaitScreen();
     CardGroupController.GetInstance.EnableDropButton();
     UiManager.GetInstance.DisableResultScreen();
     CardGroupController.GetInstance.EnableOpenPile();
     //Once every one joins get the active player status
     RoomStatus();
 }
コード例 #2
0
 private void OncardDraw(CardDrawRes response)
 {
     //Move card to player position
     closedCard    = response.closedDeck;
     discardedCard = response.discardPile;
     selectedCard  = response.card;
     UiManager.GetInstance.OnCardDraw(response);
     CardGroupController.GetInstance.EnableDropButton(true);
 }
コード例 #3
0
 private void OnCardDiscard()
 {
     Network.Card card = new Network.Card
     {
         suitValue = selectedObject.Keys.First().suitType,
         cardValue = selectedObject.Keys.First().cardValue,
     };
     gameplayManager.DiscardCard(card);
     discardBtn.gameObject.SetActive(false);
     DeclareBtn.gameObject.SetActive(false);
 }
コード例 #4
0
        internal void DiscardCard(Network.Card drawCard)
        {
            CardDiscardRequest request = new CardDiscardRequest
            {
                user_id = int.Parse(GameVariables.userId),
                room_id = roomId,
                card    = drawCard,
            };

            SocketConnectionManager.GetInstance.SendSocketRequest(GameVariables.SocketRequestType.cardDiscard, request);
        }
コード例 #5
0
        internal void PlayerDeclare(List <Network.CardGroup> groupset, Network.Card card)
        {
            ShowCardRequest request = new ShowCardRequest
            {
                user_id    = int.Parse(GameVariables.userId),
                room_id    = roomId,
                card_group = groupset,
                show_card  = card,
            };

            SocketConnectionManager.GetInstance.SendSocketRequest(GameVariables.SocketRequestType.declare, request);
        }
コード例 #6
0
        private Network.Card GetShowCard()
        {
            Network.Card showCard = new Network.Card();
            if (selectedObject.Count > 0)
            {
                showCard.suitValue = selectedObject.ElementAt(0).Key.suitType;
                showCard.cardValue = selectedObject.ElementAt(0).Key.cardValue;
            }
            else
            {
                showCard = null;
            }

            return(showCard);
        }
コード例 #7
0
        private void OnCardDiscard(CardDiscardResResponse response)
        {
            discardedCard = response.discardPile;
            playerTurn    = response.playerTurn;
            closedCard    = response.closedDeck;
            remainingTime = response.remainingTime;
            PlayerCard _playerCard = new PlayerCard
            {
                cardValue = discardedCard.cardValue,
                suitValue = discardedCard.suitValue
            };

            UiManager.GetInstance.MoveDiscardedCard(_playerCard, response.userId);
            UiManager.GetInstance.StartTimer(playerTurn, remainingTime, OnTimerComplete);
            isCardDrawn = false;
            CardGroupController.GetInstance.EnableDropButton(true);
            //UiManager.GetInstance.StartTimer(playerTurn, remainingTime, OnTimerComplete);
        }