-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerCharacter.cpp
53 lines (45 loc) · 1008 Bytes
/
PlayerCharacter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "PlayerCharacter.h"
void PlayerCharacter::TakeTurn()
{
// deck will no longer be taking a turn if a card has been played
if (hand->takingTurn == false)
{
turnTaken = true;
}
}
void PlayerCharacter::StartTurn()
{
turn = true;
hand->takingTurn = true;
}
void PlayerCharacter::ResetTurn()
{
turn = false;
hand->takingTurn = false;
turnTaken = false;
}
int PlayerCharacter::GetHandSize()
{
return hand->GetHandSize();
}
void PlayerCharacter::ForceDrawCard(int numOfCards)
{
for (int i = 0; i < numOfCards; i++)
{
hand->DrawCard();
}
turnTaken = true;
}
SDL_Color PlayerCharacter::PickNewColour()
{
PlayerColorPicker picker;
return picker.Run();
}
PlayerCharacter::PlayerCharacter(Display* display, Deck* drawDeck, Deck* playDeck, Hand** handReturn)
{
hand = new PlayerHand({ 30, 700 - 200, 1200 - 30, 200 }, drawDeck, playDeck);
display->AddRenderable(hand);
hand->FillHand();
// returning the hand to the gameMaster to be put in the eventHandler
*handReturn = hand;
}