More property work

Add StringProperty
Add possibility for callbacks
Switch RenderablePlanet to use Properties
This commit is contained in:
Alexander Bock
2014-05-03 19:53:12 +02:00
parent 8d2e86447c
commit ac38f73faa
10 changed files with 246 additions and 53 deletions

View File

@@ -93,9 +93,11 @@ void PropertyOwner::addProperty(Property* prop) {
<< "' already present in PropertyOwner");
return;
}
else
else {
// Otherwise we have found the correct position to add it in
_properties.insert(it, prop);
prop->setPropertyOwner(this);
}
}
void PropertyOwner::addProperty(Property& prop) {
@@ -114,6 +116,7 @@ void PropertyOwner::removeProperty(Property* prop) {
// If we found the property identifier, we can delete it
if (it != _properties.end() && (*it)->identifier() == prop->identifier()) {
(*it)->setPropertyOwner(nullptr);
_properties.erase(it);
}
else