Renamed AnimationSettings -> AnimationManager.
[tagua/yd.git] / src / movefactory.h
blobb309a5792c649eb472b37ad350a2114532cdf486
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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.
9 */
11 #ifndef MOVEFACTORY_H
12 #define MOVEFACTORY_H
14 #include "usermove.h"
16 template <typename Variant>
17 struct MoveFactory {
18 static typename Variant::Move createNormalMove(const NormalUserMove& move) {
19 return typename Variant::Move(move.from, move.to,
20 static_cast<typename Variant::Piece::PromotionType>(move.promotionType));
23 static typename Variant::Move createDropMove(const DropUserMove& move) {
24 return Variant::Move::createDropMove(move.m_pool, move.m_piece_index, move.m_to);
27 static NormalUserMove toNormal(const typename Variant::Move& move) {
28 return NormalUserMove(move.from, move.to);
32 #endif // MOVEFACTORY_H