예제 #1
0
파일: Player.cs 프로젝트: roadf5/HSMod
    public BaseCard DrawFromDeck(BaseCard card)
    {
        if (Deck.Contains(card))
        {
            if (Hand.Count < MaxCardsInHand)
            {
                // Moving the card to the Hand
                Hand.Add(card);
                Deck.Remove(card);

                // Creating the visual controller for the card
                CardController cardController = CardController.Create(card);
                card.Controller = cardController;

                // Adding the Cardcontroller to the HandController
                HandController.Add(cardController);

                // Firing OnDrawn events
                card.OnDrawn();
                EventManager.Instance.OnCardDrawn(this, card);

                // Updating the Player glows
                UpdateSprites();

                return(card);
            }
            else
            {
                // TODO : Discard the card

                // Updating the Player glows
                UpdateSprites();
            }
        }

        return(null);
    }