Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        currentSelect = null;
        drawDeck      = new Deck();
        drawDeck.Initialise();                                      //Generate all the cards

        discardDeck         = new Deck();
        playerCardsInHand   = new CardsInHand();
        computerCardsInHand = new CardsInHand();
        mMachine            = new CherkiStateMachine();

        UpdateCurrentState();
        ShuffleDrawDeck();                                          //Shuffle the draw deck
        InitialDistribution();                                      //Distribute 8 cards to each player
        playerCardsInHand.Sort();                                   //Rearrange the hand cards
        computerCardsInHand.Sort();
        UpdateCardsInHand(playerCardsInHand, displayCards);         //Display cards of both players
        UpdateCardsInHand(computerCardsInHand, displayCards_AI);
        deckToDraw    = CherkiMachineState.SourceDeck.None;
        cardToDiscard = null;


        mAI.enabled   = true;                                       //Enable the AI script
        isInitialised = true;
    }
Ejemplo n.º 2
0
    public override bool DiscardCard(Card card) //Discard a card from cards in hand
    {
        if (card != null)
        {
            mCards.Remove(card);
            discardDeck.Add(card);
            discardDeck.LeftShiftElement();
            mCards.Sort();

            return(true);
        }
        else
        {
            Debug.Log("Error, no card selected");
            return(false);
        }
    }
Ejemplo n.º 3
0
 public void SortCards()
 {
     CardsInHand.Sort();
 }
Ejemplo n.º 4
0
        public void AddCard(Card card)
        {
            CardsInHand.Add(card);

            CardsInHand.Sort();
        }
Ejemplo n.º 5
0
 public int SortHand()
 {
     CardsInHand.Sort();
     return(0);
 }
Ejemplo n.º 6
0
 //allows hand sort to be called
 public void SortHand()
 {
     CardsInHand.Sort();
 }