storePtypeOSquare.h
Go to the documentation of this file.
00001 /* storePtypeOSquare.h
00002  */
00003 #ifndef _STORE_PTYPEO_POSITION_H
00004 #define _STORE_PTYPEO_POSITION_H
00005 #include "osl/container/ptypeOSquareVector.h"
00006 namespace osl
00007 {
00008   namespace effect_action
00009   {
00013     struct StorePtypeOSquare
00014     {
00015       container::PtypeOSquareVector *out;
00016       Square target;
00017       StorePtypeOSquare(container::PtypeOSquareVector *s, Square t) 
00018         : out(s), target(t)
00019       {
00020       }
00021       template<Player P,Ptype Type>
00022       void doActionPtype(Piece p)
00023       {
00024         store(p);
00025       }
00026       template<Player P>
00027       void doAction(Piece p, Square)
00028       {
00029         store(p);
00030       }
00031     
00032       void store(Piece p)
00033       {
00034         const PtypeO ptypeO = p.ptypeO();
00035         out->push_back(std::make_pair(ptypeO, p.square()));
00036       }
00037     };
00038   } // namespace effect_action
00039 } // namespace osl
00040 #endif // _STORE_PTYPEO_POSITION_H
00041 // ;;; Local Variables:
00042 // ;;; mode:c++
00043 // ;;; c-basic-offset:2
00044 // ;;; End:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines