From 23a4f6aa162cf42eae31cc6bb4486949f4aaafa7 Mon Sep 17 00:00:00 2001 From: ancarola Date: Tue, 22 Jan 2019 23:52:04 +0100 Subject: Here we go --- engine/include/core/object.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 engine/include/core/object.hpp (limited to 'engine/include/core/object.hpp') diff --git a/engine/include/core/object.hpp b/engine/include/core/object.hpp new file mode 100644 index 0000000..1992d2a --- /dev/null +++ b/engine/include/core/object.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include +#include +#include +#include + +#include "types.hpp" + +namespace flat +{ + namespace core + { + class object; + } +} + +class flat::core::object +{ + std::string id; + + /* Common list of objects */ + static std::list all_objects; + +public: + + object(); + ~object(); + + void set_id(const std::string&); + + const std::string& get_id() const; + + /* Static accessors to allObject */ + + static bool is_allocated(object*); + + static std::vector& get_by_id(const std::string& id, std::vector&); + + static std::string random_id(uint8_t length = 8); +}; + -- cgit v1.2.1