Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
cBrewingRecipes Class Reference

#include <BrewingRecipes.h>

Classes

struct  cRecipe
 

Public Member Functions

 cBrewingRecipes (void)
 
const cRecipeGetRecipeFrom (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...
 

Detailed Description

Definition at line 14 of file BrewingRecipes.h.

Member Typedef Documentation

◆ cRecipes

using cBrewingRecipes::cRecipes = std::vector<std::unique_ptr<cBrewingRecipes::cRecipe> >
private

Definition at line 47 of file BrewingRecipes.h.

Constructor & Destructor Documentation

◆ cBrewingRecipes()

cBrewingRecipes::cBrewingRecipes ( void  )

Definition at line 14 of file BrewingRecipes.cpp.

Member Function Documentation

◆ AddRecipeFromLine()

void cBrewingRecipes::AddRecipeFromLine ( AString  a_Line,
unsigned int  a_LineNum 
)
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.

◆ ClearRecipes()

void cBrewingRecipes::ClearRecipes ( void  )
private

Definition at line 123 of file BrewingRecipes.cpp.

◆ GetRecipeFrom()

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.

◆ IsBottle()

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.

◆ IsFuel()

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.

◆ IsIngredient()

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.

◆ ParseItem()

bool cBrewingRecipes::ParseItem ( const AString a_String,
cItem a_Item 
)
private

Parses an item string, returns true if successful.

Definition at line 114 of file BrewingRecipes.cpp.

◆ ReloadRecipes()

void cBrewingRecipes::ReloadRecipes ( void  )

Definition at line 23 of file BrewingRecipes.cpp.

Member Data Documentation

◆ m_Recipes

cRecipes cBrewingRecipes::m_Recipes
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.


The documentation for this class was generated from the following files: