2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 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__MOVEFACTORY_H
12 #define HLVARIANT__MOVEFACTORY_H
16 #include "variantdata.h"
20 template <typename GameState
>
22 typedef typename
GameState::Move Move
;
23 typedef typename
GameState::Board::Piece Piece
;
25 virtual ~MoveFactory() { }
27 virtual Move
createNormalMove(const NormalUserMove
& move
) {
28 return Move(move
.from
, move
.to
, static_cast<typename
Piece::Type
>(move
.promotionType()));
31 virtual Move
createDropMove(const DropUserMove
& move
) {
35 virtual NormalUserMove
toNormal(const Move
& move
) {
36 return NormalUserMove(move
.from
, move
.to
);
42 #endif // HLVARIANT__MOVEFACTORY_H