summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
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);
};
}