Exemple #1
0
        } //! Works!

        public AnimalCard Draw(int choice, Player otherPlayer)
        {
            AnimalCard card = otherPlayer.Hand[choice];

            hand.Add(otherPlayer.Hand[choice]);
            otherPlayer.Hand.RemoveAt(choice);
            CardDrawn?.Invoke(this, new DrawEventArgs(card, otherPlayer, choice));
            return(card);
        } //! Seems to work
        internal StateManager(StateObject stateObject)
        {
            Logger.Logger.Log("Initialising State Manager");

            // Initialising all the state objects
            Logger.Logger.Log("Initialising all the state objects");
            resetState = new Reset(this);
            cardDrewState = new CardDrawn(this);
            deckShuffledState = new DeckShuffled(this);
            deckIsEmptyState = new DeckIsEmpty(this);

            // Updating the StateObject with inital values, i.e., newly reset deck and initial current state are "RESET"
            Logger.Logger.Log("Updating the StateObject with inital values");
            this.stateObject = stateObject;
            deck = new Deck(this.stateObject);
        }