Commit 52defbc234e070c952e3974700afbc11572ce922

Authored by Thomas R. Koll
1 parent 59ac4f734e
Exists in master

Create player.stones

Showing 1 changed file with 14 additions and 6 deletions Side-by-side Diff

... ... @@ -5,19 +5,27 @@
5 5  
6 6 #define DEBUG 1
7 7  
  8 +#define PLAYER_STONES 6
8 9  
  10 +struct Stone {
  11 + int position; // where a stone is at right now
  12 + bool notInPlay;
  13 + bool finished;
  14 + Stone() : notInPlay(true), finished(false), position(0) {};
  15 +};
  16 +
9 17 struct Player {
10 18 short score; // defaults o 0
11 19 short saturation; // their colour
12   - int stones[6];
  20 + Stone* stones;
13 21 unsigned int field;
14 22 char* name;
15 23 Player();
16   - Player(unsigned int field, char* name) : field(field), score(0), name(name) {};
17   -};
18   -
19   -struct Stone {
20   - int position; // where a stone is at right now
  24 + Player(unsigned int field, char* name) : field(field), score(0), name(name) {
  25 + for(int i=0; i < PLAYER_STONES; i++) {
  26 + stones[i] = Stone();
  27 + }
  28 + };
21 29 };
22 30  
23 31 struct Game {