Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <BrewingRecipes.h>
Classes | |
struct | cRecipe |
Public Member Functions | |
cBrewingRecipes (void) | |
const cRecipe * | GetRecipeFrom (const cItem &a_Input, const cItem &a_Ingredient) const |
Returns a recipe for the specified input, nullptr if no recipe found. More... | |
bool | IsBottle (const cItem &a_Item) const |
Returns true if the item is a bottle / potion, false if not. More... | |
bool | IsFuel (const cItem &a_Item) const |
Returns true if the item is the fuel, false if not. More... | |
bool | IsIngredient (const cItem &a_Ingredient) const |
Returns true if the item is a ingredient, false if not. More... | |
void | ReloadRecipes (void) |
Private Types | |
using | cRecipes = std::vector< std::unique_ptr< cBrewingRecipes::cRecipe > > |
Private Member Functions | |
void | AddRecipeFromLine (AString a_Line, unsigned int a_LineNum) |
Parses the recipe contained in the line, adds it to m_pState's recipes. More... | |
void | ClearRecipes (void) |
bool | ParseItem (const AString &a_String, cItem &a_Item) |
Parses an item string, returns true if successful. More... | |
Private Attributes | |
cRecipes | m_Recipes |
The collection of parsed recipes. More... | |
Definition at line 14 of file BrewingRecipes.h.
|
private |
Definition at line 47 of file BrewingRecipes.h.
cBrewingRecipes::cBrewingRecipes | ( | void | ) |
Definition at line 14 of file BrewingRecipes.cpp.
|
private |
Parses the recipe contained in the line, adds it to m_pState's recipes.
Logs a warning to the console on input error.
Definition at line 63 of file BrewingRecipes.cpp.
|
private |
Definition at line 123 of file BrewingRecipes.cpp.
const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom | ( | const cItem & | a_Input, |
const cItem & | a_Ingredient | ||
) | const |
Returns a recipe for the specified input, nullptr if no recipe found.
Definition at line 132 of file BrewingRecipes.cpp.
bool cBrewingRecipes::IsBottle | ( | const cItem & | a_Item | ) | const |
Returns true if the item is a bottle / potion, false if not.
Definition at line 220 of file BrewingRecipes.cpp.
bool cBrewingRecipes::IsFuel | ( | const cItem & | a_Item | ) | const |
Returns true if the item is the fuel, false if not.
Definition at line 229 of file BrewingRecipes.cpp.
bool cBrewingRecipes::IsIngredient | ( | const cItem & | a_Ingredient | ) | const |
Returns true if the item is a ingredient, false if not.
Definition at line 198 of file BrewingRecipes.cpp.
Parses an item string, returns true if successful.
Definition at line 114 of file BrewingRecipes.cpp.
void cBrewingRecipes::ReloadRecipes | ( | void | ) |
Definition at line 23 of file BrewingRecipes.cpp.
|
mutableprivate |
The collection of parsed recipes.
GetRecipeFrom may cache splash variants of recipes here but the observable behaviour is constant, so this should be mutable.
Definition at line 60 of file BrewingRecipes.h.