diff options
author | ancarola <raffaele.ancarola@epfl.ch> | 2019-01-22 23:52:04 +0100 |
---|---|---|
committer | ancarola <raffaele.ancarola@epfl.ch> | 2019-01-22 23:52:04 +0100 |
commit | 23a4f6aa162cf42eae31cc6bb4486949f4aaafa7 (patch) | |
tree | 51f1abe2b3ab642784d30cd8682100e69d77d78f /engine/include/core/object.hpp | |
parent | Add include headers of libraries (diff) | |
download | flatland-23a4f6aa162cf42eae31cc6bb4486949f4aaafa7.tar.gz flatland-23a4f6aa162cf42eae31cc6bb4486949f4aaafa7.zip |
Here we go
Diffstat (limited to 'engine/include/core/object.hpp')
-rw-r--r-- | engine/include/core/object.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
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 <list> +#include <vector> +#include <string> +#include <initializer_list> + +#include "types.hpp" + +namespace flat +{ + namespace core + { + class object; + } +} + +class flat::core::object +{ + std::string id; + + /* Common list of objects */ + static std::list<object*> 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<object*>& get_by_id(const std::string& id, std::vector<object*>&); + + static std::string random_id(uint8_t length = 8); +}; + |