Initial implementation of the new abstraction architecture.
[tagua.git] / src / variants / xchess / animator.h
blob4622fbee4a9d74144e9fc7abb980f9311321ff0e
1 /*
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.
9 */
11 #ifndef ANIMATOR_H
12 #define ANIMATOR_H
14 #include <boost/shared_ptr.hpp>
15 #include "animation.h"
16 #include "random.h"
18 class AnimationGroup;
19 class PointConverter;
20 class GraphicalPosition;
21 #if 0
22 /**
23 * A variant-agnostic animator.
24 * Can be used as a base class for other specialized animators.
26 template <typename Variant>
27 class SimpleAnimator {
28 protected:
29 typedef boost::shared_ptr<AnimationGroup> AnimationPtr;
30 typedef GenericGraphicalPosition<Variant> GPosition;
31 typedef typename WrappedGraphicalPosition<Variant>::GElement GElement;
32 typedef typename Variant::Position Position;
33 typedef typename Variant::Piece Piece;
34 typedef typename Variant::Move Move;
36 PointConverter* m_converter;
37 boost::shared_ptr<GPosition> m_position;
38 Random m_random;
40 bool m_anim_movement;
41 bool m_anim_explode;
42 bool m_anim_fade;
43 bool m_anim_rotate;
45 virtual boost::shared_ptr<MovementAnimation>
46 createMovementAnimation(const GElement& element, const QPoint& destination);
48 virtual boost::shared_ptr<Animation> createCapture(const Point& p,
49 const GElement& piece,
50 const GElement& captured,
51 const Position& pos);
53 virtual void finalizeBackAnimation(AnimationPtr,
54 const Position&,
55 const Move&) { }
56 virtual void finalizeForwardAnimation(AnimationPtr,
57 const Position&,
58 const Move&) { }
59 public:
60 SimpleAnimator(PointConverter* converter, const boost::shared_ptr<GPosition>& position);
61 virtual ~SimpleAnimator() { }
62 AnimationPtr warp(const Position&);
63 AnimationPtr forward(const Position&, const Move& move);
64 AnimationPtr back(const Position&, const Move& move);
66 #endif
69 #endif // ANIMATOR_H