Example #1
0
    public void DrawCardFromDeck(Card.Team team)
    {
        if (team == Card.Team.Friendly && friendlyDeckCards.Count != 0 && friendlyHandCards.Count < 10)
        {
            int        random   = Random.Range(0, friendlyDeckCards.Count);
            GameObject tempCard = friendlyDeckCards[random];

            //tempCard.transform.position = friendlyHandPos.position;
            tempCard.GetComponent <Card>().newPos = friendlyHandPos.position;
            tempCard.GetComponent <Card>().SetCardStatus(Card.CardStatus.InHand);

            friendlyDeckCards.Remove(tempCard);
            friendlyHandCards.Add(tempCard);
        }

        if (team == Card.Team.Opponent && opponentDeckCards.Count != 0 && opponentHandCards.Count < 10)
        {
            int        random   = Random.Range(0, opponentDeckCards.Count);
            GameObject tempCard = opponentDeckCards[random];

            tempCard.transform.position = opponentHandPos.position;
            tempCard.GetComponent <Card>().SetCardStatus(Card.CardStatus.InHand);

            opponentDeckCards.Remove(tempCard);
            opponentHandCards.Add(tempCard);
        }

        OnUpdate();
        PresentHand();
    }
Example #2
0
    public void PlaceRandomCard(Card.Team team)
    {
        if (team == Card.Team.Friendly && friendlyHandCards.Count != 0)
        {
            int        random   = Random.Range(0, friendlyHandCards.Count);
            GameObject tempCard = friendlyHandCards[random];

            PlaceCard(tempCard.GetComponent <Card>());
        }

        if (team == Card.Team.Opponent && opponentHandCards.Count != 0)
        {
            int        random   = Random.Range(0, opponentHandCards.Count);
            GameObject tempCard = opponentHandCards[random];

            PlaceCard(tempCard.GetComponent <Card>());
        }

        OnUpdate();
        EndTurn();

        PresentTable();
        PresentHand();
    }