diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 15:43:59 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-15 15:43:59 +0100 |
commit | 23eae734c5e8a49c02e48fe0b401d610abfee9c8 (patch) | |
tree | 02311af36b8c2a10f8b69543b7b38e498bd42bd8 /src/entity.hpp | |
parent | 2e0c0009806860e4e8ac24663afdc5d926d1213f (diff) |
a
Diffstat (limited to 'src/entity.hpp')
-rw-r--r-- | src/entity.hpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/entity.hpp b/src/entity.hpp index 34aec0af..6bfad752 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -3,6 +3,7 @@ #include "src/global-coords.hpp" #include "src/rotation.hpp" #include "src/pass-mode.hpp" +#include "src/entity-type.hpp" #include <memory> #include <vector> @@ -13,10 +14,6 @@ struct anim_atlas; struct world; struct chunk; -enum class entity_type : std::uint8_t { - none, character, scenery, -}; - struct entity_proto { std::shared_ptr<anim_atlas> atlas; @@ -62,14 +59,16 @@ struct entity virtual bool operator==(const entity_proto& e0) const; operator entity_proto() const; - virtual bool can_activate(It it, struct chunk& c) const; - virtual bool activate(It it, struct chunk& c); - virtual bool update(It it, struct chunk& c, float dt) = 0; - virtual void rotate(It it, struct chunk& c, rotation r); + virtual bool can_activate(It it) const; + virtual bool activate(It it); + virtual bool update(It it, float dt) = 0; + virtual void rotate(It it, rotation r); static Pair<global_coords, Vector2b> normalize_coords(global_coords coord, Vector2b cur_offset, Vector2i delta); - [[nodiscard]] virtual bool can_move_to(Vector2i delta, struct chunk& c); - static void move(It it, Vector2i delta, struct chunk& c); + [[nodiscard]] virtual bool can_move_to(Vector2i delta); + static void move(It it, Vector2i delta); + void update_bbox(Vector2b bbox_offset, Vector2ub bbox_size); // todo + bool is_dynamic() const; friend struct world; |