All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
allMoves.h
Go to the documentation of this file.
1 #ifndef OSL_GENERATE_ALL_MOVES_H
2 #define OSL_GENERATE_ALL_MOVES_H
4 #include "osl/misc/loki.h"
8 #include <boost/static_assert.hpp>
9 
10 namespace osl
11 {
12  namespace container
13  {
14  class MoveVector;
15  }
16  namespace move_generator
17  {
22  template<class Action>
23  class AllMoves
24  {
25  BOOST_CLASS_REQUIRE(Action,osl::move_action,Concept);
26  public:
32  template<Player P>
33  static void generateOnBoard(const NumEffectState& state, Action& action);
34 
40  template<Player P>
41  static void generate(const NumEffectState& state, Action& action);
42 
43  static void generate(Player p, const NumEffectState& state, Action& action)
44  {
45  if(p==BLACK)
46  generate<BLACK>(state,action);
47  else
48  generate<WHITE>(state,action);
49  }
50  };
51 
52  } // namespace move_generator
53 
55  {
56  static void generate(Player p, const NumEffectState& state, container::MoveVector&);
57  template <Player P>
58  static void generate(const NumEffectState& state, MoveVector& out)
59  {
61  store_t store(out);
63  }
64  template <Player P>
65  static void generateOnBoard(const NumEffectState& state, MoveVector& out)
66  {
68  store_t store(out);
70  }
71  };
72 } // namespace osl
73 
74 #endif /* OSL_GENERATE_ALL_MOVES_H */
75 // ;;; Local Variables:
76 // ;;; mode:c++
77 // ;;; c-basic-offset:2
78 // ;;; End: