Study Dungeon  1.0.0
A group project for COSC345
gameloop.h
Go to the documentation of this file.
1 
11 #pragma once
12 #ifndef GAMELOOP_H
13 #define GAMELOOP_H
14 
15 #include "card_types.h"
16 #include "player.h"
17 #include "playing_card.h"
18 #include "util.h"
19 #include <ctime>
20 #include <iostream>
21 #include <string>
22 
29 class Game
30 {
31 public:
35  short turn;
44 
50  void damageEffect(PlayingCard &card);
51 
57  void healEffect(PlayingCard &card);
58 
63  void swapHandEffect();
64 
69  void switchTurn();
70 
76  void playEffect(PlayingCard &card);
77 
82  void drawCard();
83 
91 
96  Game();
97 
102  void nextTurn(PlayingCard &nextCard);
103 
114  bool isGameOver();
115 
121  short getWinner();
122 };
123 
130 std::vector<PlayingCard> generateDeck(int numCards);
131 
132 #endif
Defines the cards types for the card duel.
Represents a Game.
Definition: gameloop.h:30
Player p1
Definition: gameloop.h:39
bool isGameOver()
Checks if the game is over.
Definition: gameloop.cpp:87
Player p2
Definition: gameloop.h:43
void swapHandEffect()
Swap the hands between the players.
Definition: gameloop.cpp:112
void switchTurn()
Switches the turn to the next player.
Definition: gameloop.cpp:71
void playEffect(PlayingCard &card)
Plays the effect of the given playing card.
Definition: gameloop.cpp:37
void healEffect(PlayingCard &card)
Apply the heal effect to the player whose turn it is.
Definition: gameloop.cpp:119
void damageEffect(PlayingCard &card)
Apply the damage effect to the player whose turn it is.
Definition: gameloop.cpp:131
short turn
Definition: gameloop.h:35
Game()
Construct a new Game object.
Definition: gameloop.cpp:17
short getWinner()
Which player was the winner.
Definition: gameloop.cpp:100
void nextTurn(PlayingCard &nextCard)
Plays the next turn of the game.
Definition: gameloop.cpp:24
void drawCard()
Draws a card for the player whose turn it is.
Definition: gameloop.cpp:55
Class that represents a Player.
Definition: player.h:28
Class to define the playing card object.
Definition: playing_card.h:24
std::vector< PlayingCard > generateDeck(int numCards)
Generates a hand.
Definition: gameloop.cpp:144
This file defines the classes and methods for a Player.
This file defines the classes and methods used for a Playing Card.
Contains useful helper functions.