This commit is contained in:
anon
2024-07-01 23:40:15 +02:00
parent 9e85c78bcf
commit 47bf7b2aad
58 changed files with 1216 additions and 0 deletions

View File

@ -0,0 +1,31 @@
#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