00001
00002
00003 #ifndef _STOREMOVEACTION_H
00004 #define _STOREMOVEACTION_H
00005 #include "osl/container/moveVector.h"
00006 #include "osl/piece.h"
00007
00008 namespace osl
00009 {
00010 namespace move_action
00011 {
00015 struct Store
00016 {
00017 FixedCapacityVectorPushBack<Move> moves;
00018 template <size_t Capacity>
00019 explicit Store(FixedCapacityVector<Move, Capacity>& v)
00020 : moves(v.pushBackHelper())
00021 {
00022 }
00024 void simpleMove(Square ,Square ,Ptype , bool ,Player ,Move move){
00025 assert(move.isValid());
00026 moves.push_back(move);
00027 }
00037 void unknownMove(Square ,Square ,Piece ,Ptype ,bool ,Player ,Move move)
00038 {
00039 assert(move.isValid());
00040 moves.push_back(move);
00041 }
00043 void dropMove(Square ,Ptype ,Player ,Move move)
00044 {
00045 assert(move.isValid());
00046 moves.push_back(move);
00047 }
00048
00049 void simpleMove(Square from,Square to,Ptype ptype,
00050 bool isPromote,Player p)
00051 {
00052 simpleMove(from,to,ptype,isPromote,p,
00053 Move(from,to,ptype,PTYPE_EMPTY,isPromote,p));
00054 }
00055 void unknownMove(Square from,Square to,Piece captured,
00056 Ptype ptype,bool isPromote,Player p)
00057 {
00058 unknownMove(from,to,captured,ptype,isPromote,p,
00059 Move(from,to,ptype,captured.ptype(),isPromote,p));
00060 }
00061 void dropMove(Square to,Ptype ptype,Player p)
00062 {
00063 dropMove(to,ptype,p,
00064 Move(to,ptype,p));
00065 }
00066 };
00067 }
00068 }
00069
00070 #endif
00071
00072
00073
00074