Beispiel #1
0
    private void RPC_MasterDealCardToPlayer(string rank, string suit, string playerId)
    {
        CardSerializer datas = new CardSerializer(rank, suit);

        Card card = new Card(datas);

        PlayerCards playerCards = PlayerFunctions.GetPlayer(playerId, dataManager.GetPlayerFromPlayerCards()); //GetPlayer(playerId);

        playerCards.AddCards(card);

        Debug.Log("Using this RPC");

        // Set next turn
        playerCards.UnSetTurn();

        Player nextPlayer = playerCards.player.GetNext();

        PlayerCards nextPlayerPlayerCards = PlayerFunctions.GetPlayer(nextPlayer.NickName, dataManager.GetPlayerFromPlayerCards());

        nextPlayerPlayerCards.SetToTurn();
        // End set turn

        card = PlayerFunctions.GetSameCard(card, GetAllCards());

        dataManager.RemoveCardsFromAllCards(card);

        CardAnimator.GetComponent <CardAnimator>().AddCardToPlayerDeck(card, playerId);

        // show animation for market
        CardAnimator.GetComponent <CardAnimator>().ShowNextPlayerGeneric(nextPlayer.NickName + " plays next");
    }
Beispiel #2
0
    private void RPC_DealCardToPlayer(string rank, string suit, string playerId)
    {
        CardSerializer datas = new CardSerializer(rank, suit);

        PlayerCards playerCards = PlayerFunctions.GetPlayer(playerId, GetAllPlayerCards());

        Card card = new Card(datas);

        playerCards.AddCards(card);

        card = PlayerFunctions.GetSameCard(card, playerCards.GetAllCards());

        dataManager.RemoveCardsFromAllCards(card);
    }
Beispiel #3
0
    private void RPC_MasterDealCard(string rank, string suit, string playerId)
    {
        CardSerializer datas = new CardSerializer(rank, suit);

        Card card = new Card(datas);

        PlayerCards playerCards = PlayerFunctions.GetPlayer(playerId, dataManager.GetPlayerFromPlayerCards()); //GetPlayer(playerId);

        playerCards.AddCards(card);

        card = PlayerFunctions.GetSameCard(card, GetAllCards());

        dataManager.RemoveCardsFromAllCards(card);

        CardAnimator.GetComponent <CardAnimator>().AddCardToPlayerDeck(card, playerId);
    }