20 #ifndef __RECIPETREENODE_H__ 21 #define __RECIPETREENODE_H__ 26 #include <csutil/array.h> 43 #define CYCLIC_RECIPE_PRIORITY 100 94 return parent == NULL;
100 return children.GetSize() == 0;
void AddChild(RecipeTreeNode *child)
Add a new child.
int nextStep
The next step which needs to be executed.
bool RemoveChild(RecipeTreeNode *child)
Remove a descendant.
csArray< RecipeTreeNode * > children
Link to children nodes.
void UpdateWaitTimes(int delta)
Update wait times.
static const char * RequirementParseTypeString[]
void DumpRecipeTreeRecipes()
RecipeTreeNode * GetNextRecipe()
Gets Next Recipe.
RequirementParseType requirementParseType
Holds the way the Recipe Manager should meet requirements.
int priority
The priority of this recipe. (Level in tree, where root = 0)
void DumpRecipeTree()
Dump tree to console.
Recipe * recipe
The recipe this leaf is about.
int cost
Computed cost for this recipe. In regard of tribe.
RecipeTreeNode * parent
Link to parent node.
RecipeTreeNode(Recipe *newRecipe, int newCost, RecipeTreeNode *parent=NULL)
Constructor.
bool IsRoot()
Returns true if it's root.
int nextReq
Next requirement that should be met.
bool ModifyWait(Recipe *theRecipe, int delta)
Updates a wait time on one recipe.
RecipeTreeNode * GetTreeRecipe(Recipe *searchRecipe)
Gets a recipe from this tree.
bool IsLeaf()
Returns true if it's a leaf.
This class represents a leaf in a recipe tree.
This object represents recipes for the tribe AI.