store.h
Go to the documentation of this file.
00001 /* storeMoveAction.h
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 /*from*/,Square /*to*/,Ptype /*ptype*/, bool /*isPromote*/,Player /*p*/,Move move){
00025         assert(move.isValid());
00026         moves.push_back(move);
00027       }
00037       void unknownMove(Square /*from*/,Square /*to*/,Piece /*p1*/,Ptype /*ptype*/,bool /*isPromote*/,Player /*p*/,Move move)
00038       {
00039         assert(move.isValid());
00040         moves.push_back(move);
00041       }
00043       void dropMove(Square /*to*/,Ptype /*ptype*/,Player /*p*/,Move move)
00044       {
00045         assert(move.isValid());
00046         moves.push_back(move);
00047       }
00048       // old interfaces
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   } // namespace move_action
00068 } // namespace osl
00069 
00070 #endif /* INCLUDED_STOREMOVEACTION */
00071 // ;;; Local Variables:
00072 // ;;; mode:c++
00073 // ;;; c-basic-offset:2
00074 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines