a!= GetTree()->GetAttributeDescriptorList(GetLevel()).end();
++a)
{
- UnsafeSetAttribute( a->GetName(), "" );
+ UnsafeSetAttribute( a->GetKey(), "" );
}
}
}
//=============================================================
+ //=============================================================
+ /// Ctor with parent and attributes map
+ Node::Node(Node* parent, const AttributeMapType& attr)
+ : mParent(parent),
+ mData(0),
+ mChildrenLoaded(false)
+ {
+ if (parent)
+ {
+ // Insert into parent's children list
+ parent->GetChildrenList().push_back(this);
+ // Initialize attributes
+ LevelDescriptor::AttributeDescriptorListType::const_iterator a;
+ for (a = GetTree()->GetAttributeDescriptorList(GetLevel()).begin();
+ a!= GetTree()->GetAttributeDescriptorList(GetLevel()).end();
+ ++a)
+ {
+ UnsafeSetAttribute( a->GetKey(), attr[a->GetKey()] );
+ }
+ }
+
+ }
+ //=============================================================
//=============================================================
AttributeMapType::iterator i = mAttributeMap.find(k);
if (i==mAttributeMap.end())
{
- std::cout<<"[Gimmick!] Node::SetAttribute : no attribute with name '"
+ std::cout<<"[Gimmick!] Node::SetAttribute : no attribute with key '"
<<k<<"'"<<std::endl;
- creaError( "[Gimmick!] Node::SetAttribute : no attribute with name '"
+ creaError( "[Gimmick!] Node::SetAttribute : no attribute with key '"
<<k<<"'");
}
i->second = v;
}
- //=============================================================
-
+ //=============================================================
+ //=============================================================
+ bool Node::Matches( const AttributeMapType& ) const
+ {
+ // TO DO
+ return false;
+ }
+ //=============================================================
}
}