Classes - ViktoriaEncheva/Card-Masters GitHub Wiki

  • Hero

        - Name/Type - e.g.  Priest, Druid, Shaman, Mage, Paladin, Warrior
    
    • Player

                - Health points
                - Current mana points - resource used for playing cards
                - Maximum mana points
                - Deck - a specific amount of cards selected by the player before the game
                - drawCard() - add one card from the player's deck to their hand
                - Hand - a collection of the cards in the hand (5 cards in the beginning of the game, and draw ONLY one 
                  card at the start of each turn)
                - PrintHand() - print the information about each card in the hand
      
  • Card (abstract)

        - Name - e.g. Lightlord, Doomcaller, DOOM!, The boogeymonster
        - Mana cost - the amount of mana needed to use the card
        - virtual GetInfo() - returns the information about the card as a string, for example for a magic card it will be: "[Mana cost] Name - Description. It will be overwritten by each subclass, because the information will be different depending on the card type
        - virtual Action(target - optional) - e.g. if creature1.Action(creature2) is called, then creature1 will attack creature2
    
    • Creature

                - Health points - if equals or less then 0, then the creature is dead
                - Attack - the defending creature will loose health points equal to the attack points of the attacking creature, and vice versa  decrease by the amount of the attack points of the attacking creature
      
    • MagicCard

                - Description - effect of the card
      
  • Game

        - Player1
        - Player2
        - TurnIndicator - holds the information about whose turn is it
        - Winner
        - Field - all creatures on the field and the remaining health and attack points for each one, as well as the players health points
        - PrintField() - print the information about the field
        - Turn()
        - IsOver() - if one of the players has 0 or less health points then the game is over and the other one is the winner
    
  • Deck

        - AddCard() - add a card to the deck
        - GetCard() - get a card from the deck
        - RemoveCard() - remove a card from the deck
        - Cards - a collection of the cards in the deck