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.
14 #include "animation.h"
19 class AnimationFactory
;
23 * Can be used as a base class for other specialized animators.
25 template <typename Variant
>
28 typedef typename UnwrappedGraphicalAPIPtr
<Variant
>::type API
;
29 typedef typename
Variant::Position Position
;
30 typedef typename
Variant::Move Move
;
31 typedef typename
Variant::Piece Piece
;
34 BaseAnimator(API cinterface
)
35 : m_cinterface(cinterface
) { }
36 virtual ~BaseAnimator() { }
38 virtual AnimationGroupPtr
warp(const Position
& final
);
39 virtual AnimationGroupPtr
forward(const Position
& final
, const Move
& move
);
40 virtual AnimationGroupPtr
back(const Position
& final
, const Move
& move
);
44 template <typename _Variant
>
45 class SimpleAnimator
: BaseAnimator
<_Variant
> {
47 typedef _Variant Variant
;
49 typedef BaseAnimator
<Variant
> Base
;
51 typedef typename
Base::API API
;
52 typedef typename
Base::Position Position
;
53 typedef typename
Base::Move Move
;
54 typedef typename
Base::Piece Piece
;
56 using Base::m_cinterface
;
58 virtual SchemePtr
movement(const NamedSprite
& sprite
, const Point
& from
, const Point
& to
);
60 SimpleAnimator(API cinterface
)
61 : Base(cinterface
) { }
63 virtual AnimationGroupPtr
warp(const Position
& final
);
64 virtual AnimationGroupPtr
forward(const Position
& final
, const Move
& move
);
65 virtual AnimationGroupPtr
back(const Position
& final
, const Move
& move
);