#include "RecipieList.h" RecipieList::RecipieList(Framework::Text name) : ReferenceCounter(), name(name) {} void RecipieList::addRecipie(Recipie* recipie) { recipies.add(recipie); } Recipie* RecipieList::zFirstRecipie(CraftingStorage* zStorage) { for (Recipie* recipie : recipies) { if (recipie->testApplicability(zStorage)) return recipie; } return 0; } const Framework::Text& RecipieList::getName() const { return name; } void RecipieList::findRecipies( const ItemType* zTargetType, Framework::RCArray& recipies) { for (Recipie* recipie : this->recipies) { if (recipie->createsOutput(zTargetType)) { recipies.add(dynamic_cast(recipie->getThis())); } } }