summaryrefslogtreecommitdiff
path: root/NT/src/factory.h
diff options
context:
space:
mode:
Diffstat (limited to 'NT/src/factory.h')
-rw-r--r--NT/src/factory.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/NT/src/factory.h b/NT/src/factory.h
index ac204a0..8c44507 100644
--- a/NT/src/factory.h
+++ b/NT/src/factory.h
@@ -12,19 +12,18 @@ namespace Rotor {
~Node_factory(){
for (auto t:type_map) delete t.second;
}
- void add_type(std::string type,Node* proto){
- type_map[type]=proto;
- type_map[type]->type=type;
+ void add_type(Node* proto){
+ type_map[proto->node_type]=proto;
};
- void add_type(std::string type,Node* proto,std::string category){
- add_type(type,proto);
+ void add_type(Node* proto,std::string category){
+ add_type(proto);
if (category_map.find(category)==category_map.end()) category_map[category]=vector<Node*>();
category_map[category].push_back(proto);
};
Node *create(std::map<std::string,std::string> &settings){
- if (settings.find("type")!=settings.end()) {
- if (type_map.find(settings["type"])!=type_map.end()) {
- return type_map[settings["type"]]->clone(settings);
+ if (settings.find("node_type")!=settings.end()) {
+ if (type_map.find(settings["node_type"])!=type_map.end()) {
+ return type_map[settings["node_type"]]->clone(settings);
}
}
return NULL;