diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-20 06:29:31 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-20 07:54:17 +0100 |
commit | 1c13313ec845d43077bd7e78538358ca4e007f8a (patch) | |
tree | 95923091df12f95bae5049d88037c9c8ff39f07f /src/entity.hpp | |
parent | 38a87664deaedacf0aa8e97d9b0aa46dfb6c8ae6 (diff) |
sort entities by id rather than draw order
Diffstat (limited to 'src/entity.hpp')
-rw-r--r-- | src/entity.hpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/entity.hpp b/src/entity.hpp index ade975e4..b8c52f58 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -35,10 +35,6 @@ struct entity_proto entity_type type_of() const noexcept; }; -enum class entity_update_status : unsigned char { - not_updated, updated, updated_repositioned, updated_repositioning, -}; - struct entity { fm_DECLARE_DELETED_COPY_ASSIGNMENT(entity); @@ -67,7 +63,7 @@ struct entity virtual entity_type type() const noexcept = 0; virtual bool can_activate(size_t i) const; virtual bool activate(size_t i); - virtual entity_update_status update(size_t i, float dt) = 0; + virtual bool update(size_t i, float dt) = 0; virtual void rotate(size_t i, rotation r); virtual bool can_rotate(global_coords coord, rotation new_r, rotation old_r, Vector2b offset, Vector2b bbox_offset, Vector2ub bbox_size); virtual bool can_move_to(Vector2i delta, global_coords coord, Vector2b offset, Vector2b bbox_offset, Vector2ub bbox_aize); @@ -77,10 +73,9 @@ struct entity static Pair<global_coords, Vector2b> normalize_coords(global_coords coord, Vector2b cur_offset, Vector2i delta); bool is_dynamic() const; - size_t reposition(size_t i); bool can_rotate(rotation new_r); bool can_move_to(Vector2i delta); - size_t move_to(size_t i, Vector2i delta, rotation new_r); + [[nodiscard]] size_t move_to(size_t i, Vector2i delta, rotation new_r); friend struct world; |