aboutsummaryrefslogtreecommitdiffstats
path: root/include/components/base.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-03-14 18:19:06 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-03-14 18:19:06 -0400
commitba651a82d585c181e9632fadba5bb4d683842d44 (patch)
tree8b2711866d497dfd471903c603e2f33bd4a41a5a /include/components/base.hpp
parenta7d7d7e687cde01ed2d2ec2adb6ee5bfff8bbddc (diff)
better slash, scale fixes
Diffstat (limited to 'include/components/base.hpp')
-rw-r--r--include/components/base.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/components/base.hpp b/include/components/base.hpp
new file mode 100644
index 0000000..9139a75
--- /dev/null
+++ b/include/components/base.hpp
@@ -0,0 +1,29 @@
+#ifndef COMPONENTS_BASE_HPP_
+#define COMPONENTS_BASE_HPP_
+
+#include <entityx/entityx.h>
+#include <tinyxml2.h>
+
+using namespace tinyxml2;
+
+/**
+ * @class Component
+ * @brief A base class for all components, insures all components have similar
+ * base functionalities.
+ */
+class Component : public entityx::Component<Component> {
+public:
+ /**
+ * Constructs the component from the two given XML tags.
+ *
+ * Components can get information from two places: where the entity is defined
+ * (it's implementation, e.g. in town.xml) or from the tag's definition (e.g. entities.xml).
+ * The definition tag should be used for default values.
+ *
+ * @param imp tag for the implementation of the entity
+ * @param def tag for the definition of the component
+ */
+ virtual void fromXML(XMLElement* imp, XMLElement* def) = 0;
+};
+
+#endif // COMPONENTS_BASE_APP_