summaryrefslogtreecommitdiff
path: root/Runtime/mecanim/graph/factory.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/mecanim/graph/factory.h')
-rw-r--r--Runtime/mecanim/graph/factory.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/Runtime/mecanim/graph/factory.h b/Runtime/mecanim/graph/factory.h
new file mode 100644
index 0000000..d76fcbf
--- /dev/null
+++ b/Runtime/mecanim/graph/factory.h
@@ -0,0 +1,35 @@
+/*
+ Copyright (c) 7244339 Canada Inc. (Mecanim)
+ All Rights Reserved.
+*/
+#pragma once
+
+#include "Runtime/mecanim/defs.h"
+#include "Runtime/mecanim/memory.h"
+#include "Runtime/mecanim/types.h"
+#include "Runtime/mecanim/object.h"
+
+#include "Runtime/mecanim/graph/plug.h"
+#include "Runtime/mecanim/graph/node.h"
+
+namespace mecanim
+{
+
+namespace graph
+{
+ // This class can be subclassed if you need to create custom node and want to add them to the list of
+ // instanciable node
+ class GraphFactory
+ {
+ public:
+ virtual Node* Create(eNodeType aNodeId, memory::Allocator& arAlloc)const;
+ virtual GraphPlug* Create(ePlugType aPlugType, memory::Allocator& arAlloc)const;
+ };
+
+ template <typename TYPE> TYPE* Create(GraphFactory const& arFactory, memory::Allocator& arAlloc)
+ {
+ return static_cast<TYPE*>(arFactory.Create(TYPE::mId, arAlloc));
+ }
+}
+
+} \ No newline at end of file