viewport centers on player, doesn't go off edges
[Tsunagari.git] / src / entity.h
blobd7a3af344c898f7315897a29cab991093aabf86b
1 /******************************
2 ** Tsunagari Tile Engine **
3 ** entity.h **
4 ** Copyright 2011 OmegaSDG **
5 ******************************/
7 #ifndef ENTITY_H
8 #define ENTITY_H
10 #include <string>
12 #include "common.h"
14 class Resourcer;
15 class Sprite;
17 //! Entity Class
18 /*!
19 This class handles dynamic game objects, such as monsters, NPCs, and
20 items.
22 class Entity
24 public:
25 //! Entity Constructor
26 Entity(Resourcer* rc, const std::string descriptor,
27 const std::string spriteDescriptor);
29 //! Entity Destructor
30 ~Entity();
32 //! Entity Initializer
33 bool init();
35 //! Gosu Callback
36 void draw();
38 //! Gosu Callback
39 bool needsRedraw() const;
41 coord_t getCoordsByPixel();
42 coord_t getCoordsByTile();
44 //! Move the entity by dx, dy.
45 void moveByTile(coord_t delta);
47 protected:
48 Sprite* sprite;
49 Resourcer* rc;
50 bool redraw;
52 const std::string descriptor;
53 const std::string spriteDescriptor;
56 #endif