summaryrefslogtreecommitdiffstats
path: root/engine/include/object.hpp
diff options
context:
space:
mode:
authorancarola <raffaele.ancarola@epfl.ch>2019-01-22 01:56:51 +0100
committerancarola <raffaele.ancarola@epfl.ch>2019-01-22 01:56:51 +0100
commit844926711489c4f87c68ceab3ea245161228ad78 (patch)
tree2d983c826131b33a207db83f95e365b044227dad /engine/include/object.hpp
parentSignal change (diff)
downloadflatland-844926711489c4f87c68ceab3ea245161228ad78.tar.gz
flatland-844926711489c4f87c68ceab3ea245161228ad78.zip
Fin qui tutto bene
Diffstat (limited to 'engine/include/object.hpp')
-rw-r--r--engine/include/object.hpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/engine/include/object.hpp b/engine/include/object.hpp
new file mode 100644
index 0000000..cb7ef36
--- /dev/null
+++ b/engine/include/object.hpp
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <list>
+#include <vector>
+#include <string>
+#include <initializer_list>
+
+#include "types.h"
+
+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);
+};
+