00001 #ifndef RULES_HPP 00002 #define RULES_HPP 00003 00004 #include "Game/History.hpp" 00005 #include "Game/Move.hpp" 00006 00007 template <typename BoardType> 00008 class Rules 00009 { 00010 typedef typename BoardType::Coords Coords; 00011 00012 private: 00013 00014 public: 00015 00019 virtual void init(BoardType& cb)=0; 00020 00026 virtual bool check(const BoardType& cb, Move<Coords>& move)const=0; 00027 00033 virtual bool checkVictory(const BoardType& cb, const int color)const=0; 00034 00039 virtual bool checkDraw(const History<Move<Coords> >& history)const=0; 00040 00046 virtual void move(const BoardType& cb, const Move<Coords>& move)=0; 00047 }; 00048 00049 class RulesUtils 00050 { 00051 public: 00052 static const int PT_NONE = 0; 00058 static bool isAPiece(const Piece& piece); 00059 }; 00060 00076 #endif