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(
- int itemTypeId, Framework::RCArray<Recipie>& recipies)
- {
- for (Recipie* recipie : this->recipies)
- {
- if (recipie->createsOutput(itemTypeId))
- {
- recipies.add(dynamic_cast<Recipie*>(recipie->getThis()));
- }
- }
- }
|