-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
53 lines (41 loc) · 1.15 KB
/
player.h
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
#ifndef __PLAYER_H__
#define __PLAYER_H__
#include "board.h"
class stratego;
class player
{
public:
/* name: constructor */
/* desc: sets the team number, */
/* allocates an array of piece pointers, */
/* and then allocates each of the player's */
/* pieces. flag first, then set up in order from
1's to 10's. */
/* then bombs, then flag. */
/* params: int team */
/* return: n/a */
player(int team, char * filename, image * h, image **r);
/* name: destructor */
/* desc: deletes the pieces, then the array. */
/* params: none */
/* return: n/a */
virtual ~player();
/* name: set up */
/* desc: places the player's peices on the board. */
/* places each piece one at a time. gets the x,y of a */
/* peice, then places it on the board. */
/* params: board * b */
/* return: void */
/* abstract */
virtual void set_up(board *b, stratego * g);
/* name: move */
/* desc: gets the x,y of piece and its new x,y */
/* params: board *b */
/* return: int - true if game won */
/* abstract */
virtual int move(board *b, stratego * g)=0;
protected:
piece ** _pieces;
int _team;
};
#endif