From 20b189455545db5688ed4f14d2966380137ee2db Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Oct 2017 11:20:34 +0200 Subject: Start working on path finding. --- src/common.hpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/common.hpp') 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 sector_index_t; typedef vec_t 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; + 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 *path); + // FIXME: iterators instead of returning std::lists std::list get_sectors(rectf_t rect); std::list get_entities(rectf_t rect); std::list 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); }; } -- cgit