1 #ifndef ROGUELIKE_BASE_GAMECONTROLLER_H_
2 #define ROGUELIKE_BASE_GAMECONTROLLER_H_
5 #include <ugdk/action/scene.h>
11 #include <ugdk/math/integer2D.h>
12 #include <ugdk/math/vector2D.h>
24 typedef ugdk::action::Scene super;
35 const ugdk::math::Integer2D&
map_size()
const {
return map_size_; }
38 return y < 0 || y >= (int)(tiles_.size()) || x < 0 || x >= (
int)(tiles_[y].size());
50 return Tile(coords.x, coords.y);
53 const std::set<GameObject*>&
ObjectsAt(
const ugdk::math::Integer2D& coords);
54 const std::set<GameObject*>&
ObjectsAt(
int x,
int y) {
return ObjectsAt(ugdk::math::Integer2D(x,y)); }
68 void PropagateSound(
const ugdk::math::Integer2D& origin,
int noise_level);
74 void set_tiles(std::vector< std::vector<GameTile*> > tiles) { tiles_ = tiles; }
77 std::vector<base::GameObject*>
actors() {
return actors_; }
84 int monster_spawn_counter_;
86 void clearDeadGameObjects();
87 void addPendingGameObjects();
89 ugdk::math::Integer2D map_size_;
90 std::vector< std::vector<GameTile*> > tiles_;
93 std::vector<base::GameObject*> actors_;
95 double time_since_beggining_;
102 #endif // ROGUELIKE_BASE_GAMECONTROLLER_H_
Definition: gameobject.h:53
bool TilesNeededBlackout(GameObject *owner)
Definition: gamecontroller.cc:99
const std::set< GameObject * > & ObjectsAt(int x, int y)
Definition: gamecontroller.h:54
void BlackoutTiles()
Definition: gamecontroller.cc:106
void RemoveActor(GameObject *actor)
Definition: gamecontroller.cc:136
bool TileOutOfBounds(int x, int y) const
Definition: gamecontroller.h:37
bool TileOutOfBounds(const ugdk::math::Integer2D &coords) const
Definition: gamecontroller.h:40
static const ugdk::math::Integer2D TILE_SIZE
Definition: gamecontroller.h:28
GameTile * Tile(const ugdk::math::Integer2D &coords) const
Definition: gamecontroller.h:49
void set_tiles(std::vector< std::vector< GameTile * > > tiles)
Definition: gamecontroller.h:74
void Spawn()
Definition: gamecontroller.cc:72
void ClearActorsList()
Definition: gamecontroller.h:59
void AddGameObject(GameObject *game_object)
Definition: gamecontroller.cc:93
~GameController()
Definition: gamecontroller.cc:67
const ugdk::math::Integer2D & map_size() const
Definition: gamecontroller.h:35
const std::set< GameObject * > & ObjectsAt(const ugdk::math::Integer2D &coords)
base::GameObject * hero()
Definition: gamecontroller.h:78
Definition: gametile.h:21
void LightHeroVisibleTiles()
Definition: gamecontroller.cc:130
static GameController * reference()
Definition: gamecontroller.cc:52
GameTile * Tile(int x, int y) const
Definition: gamecontroller.h:44
int current_tick()
Definition: gamecontroller.h:70
void set_hero(GameObject *hero)
Definition: gamecontroller.h:73
void set_current_tick(int current_tick)
Definition: gamecontroller.h:72
void ShowTileAsVisible(const ugdk::math::Integer2D &tile)
Definition: gamecontroller.cc:119
Definition: gamecontroller.h:23
void AdjustCamera()
Definition: gamecontroller.cc:185
void PropagateSound(const ugdk::math::Integer2D &origin, int noise_level)
Definition: gamecontroller.cc:140
void set_map_size(ugdk::math::Integer2D map_size)
Definition: gamecontroller.h:75
void SpawnMonster()
Definition: gamecontroller.cc:89
std::vector< base::GameObject * > actors()
Definition: gamecontroller.h:77
void RequireBlackout()
Definition: gamecontroller.h:61