1 <% cvariant = variant.capitalize %>
3 #include "<%= variant %>.h"
4 #include "xchess/animator.h"
5 #include "xchess/piece.h"
6 #include "xchess/move.h"
8 class <%= cvariant %>Position : public ChessPosition {
10 typedef ChessPosition::Piece Piece;
11 <%= cvariant %>Position();
12 <%= cvariant %>Position(const ChessPosition&);
13 <%= cvariant %>Position(Piece::Color turn, bool wk, bool wq,
14 bool bk, bool bq, const Point& ep);
15 virtual <%= cvariant %>Position* clone() const { return new <%= cvariant %>Position(*this); }
18 <%= cvariant %>Position::<%= cvariant %>Position() { }
20 <%= cvariant %>Position::<%= cvariant %>Position(const ChessPosition& other)
21 : ChessPosition(other) { }
23 <%= cvariant %>Position::<%= cvariant %>Position(Piece::Color turn, bool wk, bool wq,
24 bool bk, bool bq, const Point& ep)
25 : ChessPosition(turn, wk, wq, bk, bq, ep) { }
29 class <%= cvariant %>VariantInfo {
31 typedef <%= cvariant %>Position Position;
32 typedef Position::Move Move;
33 typedef Position::Piece Piece;
34 typedef ChessAnimator Animator;
35 static void loadPieces(PixmapLoader::Info&);
36 static void forallPieces(PieceFunction& f);
37 static int moveListLayout() { return 0; }
40 void <%= cvariant %>VariantInfo::loadPieces(PixmapLoader::Info& info) {
41 ChessVariant::loadPieces(info);
44 void <%= cvariant %>VariantInfo::forallPieces(PieceFunction& f) {
45 ChessVariant::forallPieces(f);
50 VariantInfo* <%= cvariant %>Variant::static_<%= variant %>_variant = 0;
52 VariantInfo* <%= cvariant %>Variant::info() {
53 if (!static_<%= variant %>_variant)
54 static_<%= variant %>_variant = new WrappedVariantInfo<<%= cvariant %>VariantInfo>;
55 return static_<%= variant %>_variant;