diff options
Diffstat (limited to 'src/world.hpp')
-rw-r--r-- | src/world.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/world.hpp b/src/world.hpp index e805ae1f..e92979db 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -9,11 +9,12 @@ namespace floormat { +template<typename T> struct shared_ptr_wrapper; struct object; struct critter; struct critter_proto; -template<typename T> struct object_type_; -template<typename T> struct shared_ptr_wrapper; +struct scenery; +struct scenery_proto; class world final { @@ -49,6 +50,7 @@ private: std::shared_ptr<object> find_object_(object_id id); [[noreturn]] static void throw_on_wrong_object_type(object_id id, object_type actual, object_type expected); + [[noreturn]] static void throw_on_empty_scenery_proto(object_id id, global_coords pos, Vector2b offset); friend struct object; @@ -87,7 +89,7 @@ public: do_make_object(std::static_pointer_cast<object>(ret), pos, sorted); return ret; } - + template<bool sorted = true> std::shared_ptr<scenery> make_scenery(object_id id, global_coords pos, scenery_proto&& proto); template<typename T = object> std::shared_ptr<T> find_object(object_id id); shared_ptr_wrapper<critter> ensure_player_character(object_id& id, critter_proto p); |