All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
store.h
Go to the documentation of this file.
1 /* storeMoveAction.h
2  */
3 #ifndef _STOREMOVEACTION_H
4 #define _STOREMOVEACTION_H
6 #include "osl/piece.h"
7 
8 namespace osl
9 {
10  namespace move_action
11  {
15  struct Store
16  {
17  FixedCapacityVectorPushBack<Move> moves;
18  template <size_t Capacity>
19  explicit Store(FixedCapacityVector<Move, Capacity>& v)
20  : moves(v.pushBackHelper())
21  {
22  }
24  void simpleMove(Square /*from*/,Square /*to*/,Ptype /*ptype*/, bool /*isPromote*/,Player /*p*/,Move move){
25  assert(move.isValid());
26  moves.push_back(move);
27  }
37  void unknownMove(Square /*from*/,Square /*to*/,Piece /*p1*/,Ptype /*ptype*/,bool /*isPromote*/,Player /*p*/,Move move)
38  {
39  assert(move.isValid());
40  moves.push_back(move);
41  }
43  void dropMove(Square /*to*/,Ptype /*ptype*/,Player /*p*/,Move move)
44  {
45  assert(move.isValid());
46  moves.push_back(move);
47  }
48  // old interfaces
49  void simpleMove(Square from,Square to,Ptype ptype,
50  bool isPromote,Player p)
51  {
52  simpleMove(from,to,ptype,isPromote,p,
53  Move(from,to,ptype,PTYPE_EMPTY,isPromote,p));
54  }
56  Ptype ptype,bool isPromote,Player p)
57  {
58  unknownMove(from,to,captured,ptype,isPromote,p,
59  Move(from,to,ptype,captured.ptype(),isPromote,p));
60  }
61  void dropMove(Square to,Ptype ptype,Player p)
62  {
63  dropMove(to,ptype,p,
64  Move(to,ptype,p));
65  }
66  };
67  } // namespace move_action
68 } // namespace osl
69 
70 #endif /* INCLUDED_STOREMOVEACTION */
71 // ;;; Local Variables:
72 // ;;; mode:c++
73 // ;;; c-basic-offset:2
74 // ;;; End: