aboutsummaryrefslogtreecommitdiff
path: root/backend/ObjectFactory.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 01:29:58 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-30 01:29:58 +0100
commitb9e738502260b8f448289c9888203971c7749c76 (patch)
tree09477251ba49307173a112e0cd5dbdd3633346ce /backend/ObjectFactory.cpp
parente4261302944303781c952943e3290c99e2cabc52 (diff)
WIP SQL gedoe
Diffstat (limited to 'backend/ObjectFactory.cpp')
-rw-r--r--backend/ObjectFactory.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/backend/ObjectFactory.cpp b/backend/ObjectFactory.cpp
index efb7742..4a0642b 100644
--- a/backend/ObjectFactory.cpp
+++ b/backend/ObjectFactory.cpp
@@ -1,6 +1,21 @@
#include "ObjectFactory.h"
-Object * ObjectFactory::create_object() {
- return new Object();
+#include "ArmorObject.h"
+#include "ConsumableObject.h"
+#include "GoldObject.h"
+#include "WeaponObject.h"
+
+Object * ObjectFactory::create_object(ObjectType type, const char * name, const char * description) {
+ switch (type) {
+ case ARMOR: return new ArmorObject(name, description);
+ case CONSUMABLE: return new ConsumableObject(name, description);
+ case GOLD: return new GoldObject(name, description);
+ case WEAPON: return new WeaponObject(name, description);
+ }
+ return ObjectFactory::create_object(name, description);
+}
+
+Object * ObjectFactory::create_object(const char * name, const char * description) {
+ return new Object(name, description);
}