2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2007 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef HLVARIANT__CRAZYHOUSE__MOVE_H
12 #define HLVARIANT__CRAZYHOUSE__MOVE_H
17 namespace Crazyhouse
{
19 template <typename _Move
, typename _Piece
>
20 class MoveMixin
: public _Move
{
25 typedef typename
Piece::Color Color
;
32 MoveMixin(const Point
& from
, const Point
& to
, int promotionType
= -1);
33 MoveMixin(Color pool
, int index
, const Point
& to
);
36 void setDrop(const Piece
& piece
);
44 template <typename Move
, typename Piece
>
45 MoveMixin
<Move
, Piece
>::MoveMixin()
46 : m_pool(Piece::INVALID_COLOR
)
49 template <typename Move
, typename Piece
>
50 MoveMixin
<Move
, Piece
>::MoveMixin(const Point
& from
, const Point
& to
, int promotionType
)
51 : Move(from
, to
, promotionType
)
52 , m_pool(Piece::INVALID_COLOR
)
55 template <typename Move
, typename Piece
>
56 MoveMixin
<Move
, Piece
>::MoveMixin(Color pool
, int index
, const Point
& to
)
57 : Move(Point::invalid(), to
)
61 template <typename Move
, typename Piece
>
62 Piece MoveMixin
<Move
, Piece
>::drop() const {
66 template <typename Move
, typename Piece
>
67 void MoveMixin
<Move
, Piece
>::setDrop(const Piece
& drop
) {
71 template <typename Move
, typename Piece
>
72 typename
Piece::Color MoveMixin
<Move
, Piece
>::pool() const {
76 template <typename Move
, typename Piece
>
77 int MoveMixin
<Move
, Piece
>::index() const {
81 }; // namespace Crazyhouse
82 }; // namespace HLVariant
84 #endif // HLVARIANT__CRAZYHOUSE__MOVE_H