concept.h
Go to the documentation of this file.
00001 #ifndef _MOVE_ACTION_CONCEPT_H
00002 #define _MOVE_ACTION_CONCEPT_H
00003 
00004 #include "osl/square.h"
00005 #include "osl/player.h"
00006 #include "osl/piece.h"
00007 #include "osl/ptype.h"
00008 #include "osl/move.h"
00009 #include <boost/concept_check.hpp>
00010 
00011 namespace osl
00012 {
00013   namespace move_action
00014   {
00018     class MoveAction 
00019     {
00020     public:
00022       void simpleMove(Square from,Square to,Ptype ptype, 
00023                       bool isPromote,Player p,Move move);
00024 
00026       void unknownMove(Square from,Square to,Piece captured,
00027                        Ptype ptype,bool isPromote,Player p,Move move);
00029       void dropMove(Square to,Ptype ptype,Player p,Move move);
00030     };
00031 
00036     template <class T>
00037     struct Concept
00038     {
00040       void constraints() 
00041       {
00042         // MoveAction must have the following three methods
00043 
00044         // 試行錯誤中
00045         // 呼出すとinline展開などでコンパイル時間が増えるので
00046         // アドレスをとるだけにしてみる
00047         simple  = &T::simpleMove;
00048         unknown = &T::unknownMove;
00049         drop    = &T::dropMove;
00050       }
00051       void (T::*simple)(Square, Square, Ptype, bool, Player,Move);
00052       void (T::*unknown)(Square, Square, Piece, Ptype, bool, Player,Move);
00053       void (T::*drop)(Square, Ptype, Player,Move);
00054     };
00055   } // namespace move_action
00056 } // namespace osl
00057 
00058 
00059 #endif /* _MOVE_ACTION_CONCEPT_H */
00060 // ;;; Local Variables:
00061 // ;;; mode:c++
00062 // ;;; c-basic-offset:2
00063 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines