summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-10-21 11:20:34 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-10-21 13:12:42 +0200
commit20b189455545db5688ed4f14d2966380137ee2db (patch)
tree7504e059147cfae54fa466b8a4c0073ecbbc582c /src/common.hpp
parent29d124b93125d7c9de762c45876f69df3acd549d (diff)
Start working on path finding.
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/common.hpp b/src/common.hpp
index e135d56..ced0b25 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -47,8 +47,10 @@ namespace world {
typedef vec_t<int64_t, 2> sector_index_t;
typedef vec_t<int64_t, 2> tile_index_t;
+ sector_index_t sector_index_at(v2f_t x);
+ tile_index_t tile_index_at(v2f_t x);
+
class entity_t;
- class sector_iterator_t;
class sector_t {
public:
@@ -69,18 +71,26 @@ namespace world {
void generate_tile(tile_t *tile, tile_index_t index);
void generate(sector_t *sector, sector_index_t index);
+ protected:
+ friend render::state_t;
+ typedef struct {
+ v2f_t x;
+ std::string text;
+ } debug_t;
+ std::list<debug_t> debug;
+
public:
world_t(void);
sector_t *get_sector(sector_index_t index);
tile_t *get_tile(tile_index_t index);
+ bool find_path(v2f_t src, v2f_t dst, rectf_t size, std::list<v2f_t> *path);
+
// FIXME: iterators instead of returning std::lists
std::list<sector_t*> get_sectors(rectf_t rect);
std::list<entity_t*> get_entities(rectf_t rect);
std::list<entity_t*> get_render_entities(rectf_t rect);
- void render(sf::RenderWindow *window);
-
void debug_point(sf::Vector2f point);
};
@@ -113,6 +123,8 @@ namespace game {
void start(void);
void tick(void);
+
+ void debug_click(v2f_t x);
};
}