summaryrefslogtreecommitdiffhomepage
path: root/src/scenery.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-13 12:26:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-13 12:26:26 +0200
commitcb13eb86db3593e723ce06c48a5cb2c94505d6ae (patch)
tree9b56825b1debc908dc999feace69645eb56eb2f8 /src/scenery.hpp
parent2c042d30d96827941e5052d4eca0cc03965cacc8 (diff)
use inheritance for scenery, not std::variant
It's still WIP because creating scenery has to branch on all subtypes. This needs to be taken care of generically in `world::make_object()`.
Diffstat (limited to 'src/scenery.hpp')
-rw-r--r--src/scenery.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scenery.hpp b/src/scenery.hpp
index 32ba3742..be57296d 100644
--- a/src/scenery.hpp
+++ b/src/scenery.hpp
@@ -37,7 +37,7 @@ using scenery_proto_variants = std::variant<generic_scenery_proto, door_scenery_
struct scenery_proto : object_proto
{
- scenery_proto_variants subtype;
+ scenery_proto_variants subtype; // todo! add std::monostate
scenery_proto() noexcept;
scenery_proto(const scenery_proto&) noexcept;
@@ -55,9 +55,9 @@ struct scenery : object
float depth_offset() const override;
enum object_type type() const noexcept override;
virtual enum scenery_type scenery_type() const = 0;
+ virtual explicit operator scenery_proto() const;
protected:
- virtual explicit operator scenery_proto() const;
scenery(object_id id, class chunk& c, const scenery_proto& proto);
};