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(); }
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); }
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); }
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); }
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); }
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); }
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); }