Example #1
0
 void drawOpeningHand()
 {
     foreach (uint playerID in teams.Keys)
     {
         PlayerGhost p = NetworkIdentity.spawned[playerID].GetComponent <PlayerGhost>();
         p.initDeck();
         //Debug.Log(team);
         p.drawCards(cardCountOpeningHand);
     }
 }
Example #2
0
    public void mulligan(uint ownerID, List <uint> cardIDs)
    {
        //Debug.Log(ownerID);
        if (!NetworkIdentity.spawned.ContainsKey(ownerID))
        {
            return;
        }
        if (playersMulligan.Contains(ownerID))
        {
            return;
        }
        foreach (uint id in cardIDs)
        {
            //Debug.Log(id);
            if (!NetworkIdentity.spawned.ContainsKey(id))
            {
                return;
            }
            Card c = NetworkIdentity.spawned[id].GetComponent <Card>();
            if (!c)
            {
                return;
            }
            if (c.team != teams[ownerID])
            {
                return;
            }
        }
        PlayerGhost p = NetworkIdentity.spawned[ownerID].GetComponent <PlayerGhost>();

        //set p not mulligan
        p.drawCards(cardIDs.Count);
        foreach (uint id in cardIDs)
        {
            p.returnCardToDeck(NetworkIdentity.spawned[id].GetComponent <Card>());
        }
        playersMulligan.Add(ownerID);
        TargetShowMulligan(p.connectionToClient, false);
        if (playersMulligan.Count == teams.Count)
        {
            initGame();
        }
    }
Example #3
0
 public void delegateDraw(PlayerGhost p)
 {
     p.drawCards(cards);
 }