diff --git a/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h b/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h index 38e865e312df890c6d103d1ae9078aed41daaa6a..bcc1bb1c17b1b548d9e66391f914ef185ed33aec 100644 --- a/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h +++ b/MantleAPI/include/MantleAPI/Traffic/i_entity_repository.h @@ -18,6 +18,8 @@ #include <MantleAPI/Traffic/entity_properties.h> #include <MantleAPI/Traffic/i_entity.h> +#include <functional> +#include <optional> #include <string> #include <vector> @@ -35,8 +37,8 @@ class IEntityRepository virtual IStaticObject& Create(UniqueId id, const std::string& name, const StaticObjectProperties& properties) = 0; virtual IVehicle& GetHost() = 0; - virtual IEntity& Get(const std::string& name) = 0; - virtual IEntity& Get(UniqueId id) = 0; + virtual std::optional<std::reference_wrapper<IEntity>> Get(const std::string& name) = 0; + virtual std::optional<std::reference_wrapper<IEntity>> Get(UniqueId id) = 0; virtual bool Contains(UniqueId id) const = 0; virtual void Delete(const std::string& name) = 0;