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
>
23 typedef typename
GameState::Move Move
;
24 typedef typename
GameState::Board::Piece Piece
;
26 virtual ~MoveFactory() { }
28 virtual Move
createNormalMove(const NormalUserMove
& move
) {
29 return Move(move
.from
, move
.to
, static_cast<typename
Piece::Type
>(move
.promotionType
));
32 virtual Move
createDropMove(const DropUserMove
&) {
36 virtual NormalUserMove
toNormal(const Move
& move
) {
37 return NormalUserMove(move
.from(), move
.to());
43 #endif // HLVARIANT__MOVEFACTORY_H