Roguelike
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
graphic.h
Go to the documentation of this file.
1 #ifndef ROGUELIKE_COMPONENT_GRAPHIC_H_
2 #define ROGUELIKE_COMPONENT_GRAPHIC_H_
3 
4 // Inheritance
6 
7 // External Dependencies
8 #include <set>
9 #include <string>
10 
11 // Internal Dependencies
12 // (none)
13 
14 // Forward Declarations
15 #include <ugdk/action.h>
16 #include <ugdk/graphic.h>
17 #include <ugdk/math.h>
18 #include "game/base.h"
19 
20 namespace game {
21 namespace component {
22 
23 class Graphic : public ComponentBase {
24  typedef ComponentBase super;
25  public:
26  Graphic(game::base::GameObject* owner, const std::string& visual_representation, double zindex);
27  virtual ~Graphic();
28 
29  virtual void Update(double dt) = 0;
30  virtual void NodeLogic(const std::set<ugdk::math::Integer2D>& occupying_tiles) = 0;
31 
32  void SetVisibility(bool visibility);
33 
34  const ugdk::graphic::Node* node() const { return node_; }
35  ugdk::graphic::Node* node() { return node_; }
36 
37  void OnSceneAdd(ugdk::action::Scene* scene);
38 
39  protected:
40  ugdk::graphic::Node* node_;
41 };
42 
43 } // namespace component
44 } // namespace game
45 
46 #endif // ROGUELIKE_COMPONENT_GRAPHIC_H_
Definition: gameobject.h:53
Graphic(game::base::GameObject *owner, const std::string &visual_representation, double zindex)
Definition: graphic.cc:20
virtual ~Graphic()
Definition: graphic.cc:24
void OnSceneAdd(ugdk::action::Scene *scene)
Definition: graphic.cc:26
Definition: aim.cc:15
ugdk::graphic::Node * node_
Definition: graphic.h:40
Definition: componentbase.h:19
Definition: graphic.h:23
const ugdk::graphic::Node * node() const
Definition: graphic.h:34
ugdk::graphic::Node * node()
Definition: graphic.h:35
virtual void NodeLogic(const std::set< ugdk::math::Integer2D > &occupying_tiles)=0
void SetVisibility(bool visibility)
Definition: graphic.cc:30
virtual void Update(double dt)=0