|
Study Dungeon
1.0.0
A group project for COSC345
|
#include <gameloop.h>
Public Member Functions | |
| void | damageEffect (PlayingCard &card) |
| Apply the damage effect to the player whose turn it is. More... | |
| void | healEffect (PlayingCard &card) |
| Apply the heal effect to the player whose turn it is. More... | |
| void | swapHandEffect () |
| Swap the hands between the players. | |
| void | switchTurn () |
| Switches the turn to the next player. | |
| void | playEffect (PlayingCard &card) |
| Plays the effect of the given playing card. More... | |
| void | drawCard () |
| Draws a card for the player whose turn it is. | |
| Game (Player p1, Player p2) | |
| Construct a new Game object. More... | |
| Game () | |
| Construct a new Game object. | |
| void | nextTurn (PlayingCard &nextCard) |
| Plays the next turn of the game. | |
| bool | isGameOver () |
| Checks if the game is over. More... | |
| short | getWinner () |
| Which player was the winner. More... | |
Data Fields | |
| short | turn |
| Player | p1 |
| Player | p2 |
Represents a Game.
A Game involves 2 Players, which both have a deck of playing cards and a hand of cards
| void Game::damageEffect | ( | PlayingCard & | card | ) |
Apply the damage effect to the player whose turn it is.
| card | the PlayingCard object. |
| short Game::getWinner | ( | ) |
Which player was the winner.
| void Game::healEffect | ( | PlayingCard & | card | ) |
Apply the heal effect to the player whose turn it is.
| card | the PlayingCard object |
| bool Game::isGameOver | ( | ) |
Checks if the game is over.
Checks whether the game is over. Returns true if the game is over by either one player reaching 0 hit points, or neither player having any playing cards left. Returns false if none of these conditions are met.
| void Game::playEffect | ( | PlayingCard & | card | ) |
Plays the effect of the given playing card.
| card |