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 GRAPHICALAPI_H
12 #define GRAPHICALAPI_H
14 #include <boost/shared_ptr.hpp>
16 #include "pointconverter.h"
19 typedef boost::shared_ptr
<class Sprite
> SpritePtr
;
22 * This class defines the interface that will be used by the animator to modify
27 virtual ~GraphicalAPI(){}
30 * \return the current abstract position.
32 virtual const PointConverter
* converter() const = 0;
35 * \return the current abstract position.
37 virtual AbstractPosition::Ptr
position() const = 0;
40 * \return a sprite at the position \a index in the graphical pool.
42 virtual SpritePtr
getSprite(const Point
& p
) = 0;
45 * Removes a sprite at the position \a index in the graphical pool.
46 * \return the newly created sprite.
48 virtual SpritePtr
takeSprite(const Point
& p
) = 0;
51 * Sets the sprite at the position \a index in the graphical pool.
52 * \return the newly created sprite.
54 virtual SpritePtr
setSprite(const Point
& p
, const AbstractPiece
* piece
, bool use_drop
, bool show
) = 0;
57 * \return how many sprites are contained in the pool
59 virtual int poolSize(int pool
) = 0;
62 * \return the sprite at the position \a index in the graphical pool.
64 virtual SpritePtr
getPoolSprite(int pool
, int index
) = 0;
67 * Removes the sprite at the position \a index in the graphical pool.
68 * \return the removed sprite.
70 virtual SpritePtr
takePoolSprite(int pool
, int index
) = 0;
73 * Inserts a sprite at the position \a index in the graphical pool.
74 * \return the newly created sprite.
76 virtual SpritePtr
insertPoolSprite(int pool
, int index
, const AbstractPiece
* piece
) = 0;
79 #endif //GRAPHICALAPI_H