12345678910111213141516171819202122232425262728293031323334353637 |
- #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<Recipie>& recipies)
- {
- for (Recipie* recipie : this->recipies)
- {
- if (recipie->createsOutput(zTargetType))
- {
- recipies.add(dynamic_cast<Recipie*>(recipie->getThis()));
- }
- }
- }
|