open.h
Go to the documentation of this file.
00001 #ifndef _GENERATE_OPEN_MOVES_H
00002 #define _GENERATE_OPEN_MOVES_H
00003 #include "osl/move_generator/pieceOnBoard.h"
00004 #include "osl/move_generator/promoteType.h"
00005 #include "osl/move_action/concept.h"
00006 #include "osl/state/numEffectState.h"
00007 #include <boost/static_assert.hpp>
00008 // Open<StoreMoveAction> 以外の組み合わせで使うときは
00009 // open.tcc もinclude すること (但しコンパイル時間がかかるので推奨しない)
00010 
00011 namespace osl
00012 {
00013   namespace move_generator
00014   {
00020     template<class Action>
00021     class Open
00022     {
00023       // BOOST_CLASS_REQUIRE(Action,osl::move_action,Concept);
00024     public:
00025       template<Player P>
00026       static void generate(const NumEffectState& state,Piece p,Action& action,Square to,Direction dir);
00027       
00028     };
00029 
00030     struct GenerateOpen
00031     {
00032       template<class Action>
00033       static void 
00034       generate(Player pl,const NumEffectState& state,Piece p,
00035                Action& action,Square to,Direction dir)
00036       {
00037         if (pl == BLACK)
00038           Open<Action>::template generate<BLACK>(state, p, action, to, dir);
00039         else
00040           Open<Action>::template generate<WHITE>(state, p, action, to, dir);
00041       }
00042     };
00043     
00044   } // namespace move_generator
00045 } // namespace osl
00046 #endif /* _GENERATE_OPEN_MOVES_H */
00047 // ;;; Local Variables:
00048 // ;;; mode:c++
00049 // ;;; c-basic-offset:2
00050 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines