Implemented hoe

This commit is contained in:
2016-12-02 22:48:37 +02:00
parent 33de4a8d1f
commit 91c0da855b
14 changed files with 174 additions and 53 deletions

View File

@@ -313,6 +313,9 @@ GameObject* parse<GameObject> (boost::property_tree::ptree& root)
else if (child.first == "Giftable")
gameObj->addComponent(parse<Giftable>(child.second));
else if (child.first == "Hoe")
gameObj->addComponent(parse<Hoe>(child.second));
else if (child.first == "Item")
gameObj->addComponent(parse<Item>(child.second));
@@ -356,6 +359,17 @@ Configuration* parse<Configuration> (boost::property_tree::ptree& root)
return config;
}
template <>
Hoe* parse<Hoe> (boost::property_tree::ptree& root)
{
// Ensure we are on the scene node (property tree seems to add root of its own)
if (root.front().first == "Hoe")
root = root.front().second;
Hoe* hoe = new Hoe();
return hoe;
}
template <>
Item* parse<Item> (boost::property_tree::ptree& root)
{