summaryrefslogtreecommitdiffhomepage
path: root/src/hole.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-05-26 18:11:06 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-05-26 18:11:06 +0200
commite679da407d43b581afaf0539acea1143c022b245 (patch)
treea3798c7021559cc5fc66caa0350ec74edee4a015 /src/hole.hpp
parent3e1349ce28eae928c8ecfd2ec9bfdde5147ad6a8 (diff)
w
Diffstat (limited to 'src/hole.hpp')
-rw-r--r--src/hole.hpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/hole.hpp b/src/hole.hpp
index b7499ced..64e53149 100644
--- a/src/hole.hpp
+++ b/src/hole.hpp
@@ -6,16 +6,40 @@ namespace floormat {
struct hole_proto final : object_proto
{
- bool affects_render : 1 = true;
- bool affects_physics : 1 = false;
+ ~hole_proto() noexcept override;
+ hole_proto();
+ hole_proto(const hole_proto&);
+ hole_proto& operator=(const hole_proto&);
+ hole_proto(hole_proto&&) noexcept;
+ hole_proto& operator=(hole_proto&&) noexcept;
+ bool operator==(const hole_proto&) const;
+
+ uint8_t height = 0;
+ bool on_render : 1 = true;
+ bool on_physics : 1 = true;
+ bool is_wall : 1 = false;
};
-struct hole : object
+struct hole final : object
{
- bool affects_render : 1 = true;
- bool affects_physics : 1 = false;
+ uint8_t _height = 0;
+ const bool on_render : 1 = true;
+ const bool on_physics : 1 = true;
+ const bool is_wall : 1 = false;
hole(object_id id, class chunk& c, const hole_proto& proto);
+ ~hole() noexcept override;
+
+ Vector2 ordinal_offset(Vector2b offset) const override;
+ float depth_offset() const override;
+ object_type type() const noexcept override;
+ void update(const std::shared_ptr<object>& ptr, size_t& i, const Ns& dt) override;
+ bool is_dynamic() const override;
+ bool is_virtual() const override;
+
+ explicit operator hole_proto() const;
+
+ friend class world;
};
struct cut_rectangle_result