32 lines
783 B
C++
32 lines
783 B
C++
#ifndef PLAYER_H
|
|
#define PLAYER_H
|
|
|
|
typedef enum {
|
|
COOPERATE,
|
|
CONFLICT,
|
|
} reaction_t;
|
|
|
|
class Player {
|
|
public:
|
|
/* Gathered points during the game are stored internally
|
|
*/
|
|
long points = 0;
|
|
/* This is for logging the game
|
|
*/
|
|
const char * name;
|
|
/* Called before facing a new opponent
|
|
*/
|
|
virtual void new_game() = 0;
|
|
/* Called during a match;
|
|
* the return value is your response
|
|
*/
|
|
virtual reaction_t play() = 0;
|
|
/* Called after the match;
|
|
* the argument signals what your opponent played;
|
|
* you may use/store this information as you wish
|
|
*/
|
|
virtual void push_result(reaction_t opponents_last_reaction) = 0;
|
|
};
|
|
|
|
#endif
|