Roguelike
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
gametile.h
Go to the documentation of this file.
1 #ifndef ROGUELIKE_BASE_GAMETILE_H_
2 #define ROGUELIKE_BASE_GAMETILE_H_
3 
4 // Inheritance
5 // (none)
6 
7 // External Dependencies
8 #include <set> // template class
9 #include <ugdk/math/integer2D.h> // coords_
10 
11 // Internal Dependencies
12 // (none)
13 
14 // Forward Declarations
15 #include <ugdk/graphic.h>
16 #include "game/base.h"
17 
18 namespace game {
19 namespace base {
20 
21 class GameTile {
22  // Lacks operator=
23  GameTile& operator=(const GameTile&);
24 
25  public:
26  GameTile(const ugdk::math::Integer2D& coords);
27  GameTile(int x, int y);
28  ~GameTile();
29 
30  ugdk::graphic::Node* node() const { return node_; }
31 
32  void PushObject(GameObject* obj);
33  void RemoveObject(GameObject* obj);
34  void SetVisibility(bool visibility);
35 
36  int x() const { return coords_.x; }
37  int y() const { return coords_.y; }
38 
39  const ugdk::math::Integer2D& coords() const { return coords_; }
40 
41  ugdk::graphic::Node* node() { return node_; }
42 
43  const std::set<GameObject*>& objects_here() const { return objects_here_; }
44  std::set<GameObject*>& objects_here() { return objects_here_; }
45 
46  private:
47  const ugdk::math::Integer2D coords_;
48 
49  ugdk::graphic::Node* node_;
50  std::set<GameObject*> objects_here_;
51  ugdk::graphic::Drawable* ground_;
52 
53 };
54 
55 } // namespace base
56 } // namespace game
57 
58 #endif // ROGUELIKE_BASE_GAMETILE_H_
Definition: gameobject.h:53
ugdk::graphic::Node * node()
Definition: gametile.h:41
void SetVisibility(bool visibility)
Definition: gametile.cc:52
void RemoveObject(GameObject *obj)
Definition: gametile.cc:48
Definition: aim.cc:15
ugdk::graphic::Node * node() const
Definition: gametile.h:30
const ugdk::math::Integer2D & coords() const
Definition: gametile.h:39
Definition: gametile.h:21
~GameTile()
Definition: gametile.cc:39
std::set< GameObject * > & objects_here()
Definition: gametile.h:44
const std::set< GameObject * > & objects_here() const
Definition: gametile.h:43
GameTile(const ugdk::math::Integer2D &coords)
int x() const
Definition: gametile.h:36
int y() const
Definition: gametile.h:37
void PushObject(GameObject *obj)
Definition: gametile.cc:44