Advertisement
Guest User

Untitled

a guest
Jan 16th, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. // player.h
  2. #ifndef PLAYER_H_
  3. #define PLAYER_H_
  4.  
  5. #include <string>
  6. #include "board.h"
  7. #include "gamedata.h"
  8.  
  9. class Player {
  10. public:
  11.     virtual ~Player() {}
  12.     virtual Move getMove(Board &c) { return std::make_pair(std::make_pair('c', 5), std::make_pair('f', 2)); }
  13.     virtual GameData::Move getMove(Board &c) { return std::make_pair(std::make_pair('c', 5), std::make_pair('f', 2)); }
  14. };
  15.  
  16. #endif /* PLAYER_H_ */
  17.  
  18. // gamedata.h
  19. #ifndef GAMEDATA_H_
  20. #define GAMEDATA_H_
  21.  
  22. #include <utility>
  23. #include "player.h"
  24.  
  25. class Player;
  26.  
  27. namespace GameData {
  28.     enum Color {
  29.         BLACK = 0,
  30.         WHITE = 1
  31.     };
  32.     typedef typename std::pair<char, int> Position;
  33.     typedef typename std::pair< std::pair<char, int>, std::pair<char, int> > Move;
  34.     typedef typename std::pair<Player*, Player*> Players;
  35. };
  36.  
  37. #endif /* GAMEDATA_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement