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

#include <FurnaceRecipe.h>

Collaboration diagram for cFurnaceRecipe:
Collaboration graph
[legend]

Classes

struct  cFuel
 
struct  cRecipe
 
struct  sFurnaceRecipeState
 

Public Member Functions

 cFurnaceRecipe (void)
 
int GetBurnTime (const cItem &a_Fuel) const
 Returns the amount of time that the specified fuel burns, in ticks. More...
 
const cRecipeGetRecipeFrom (const cItem &a_Ingredient) const
 Returns a recipe for the specified input, nullptr if no recipe found. More...
 
bool IsFuel (const cItem &a_Item) const
 Returns true if the item is a fuel, false if not. More...
 
void ReloadRecipes (void)
 
 ~cFurnaceRecipe ()
 

Private Member Functions

void AddFuelFromLine (const AString &a_Line, unsigned int a_LineNum)
 Parses the fuel contained in the line, adds it to m_pState's fuels. More...
 
void AddRecipeFromLine (const 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 in the format "<ItemType>[: <Damage>][, <Amount>]", returns true if successful. More...
 

Private Attributes

sFurnaceRecipeStatem_pState
 

Detailed Description

Definition at line 14 of file FurnaceRecipe.h.

Constructor & Destructor Documentation

◆ cFurnaceRecipe()

cFurnaceRecipe::cFurnaceRecipe ( void  )

Definition at line 32 of file FurnaceRecipe.cpp.

◆ ~cFurnaceRecipe()

cFurnaceRecipe::~cFurnaceRecipe ( )

Definition at line 42 of file FurnaceRecipe.cpp.

Member Function Documentation

◆ AddFuelFromLine()

void cFurnaceRecipe::AddFuelFromLine ( const AString a_Line,
unsigned int  a_LineNum 
)
private

Parses the fuel contained in the line, adds it to m_pState's fuels.

Logs a warning to the console on input error.

Definition at line 114 of file FurnaceRecipe.cpp.

◆ AddRecipeFromLine()

void cFurnaceRecipe::AddRecipeFromLine ( const 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 156 of file FurnaceRecipe.cpp.

◆ ClearRecipes()

void cFurnaceRecipe::ClearRecipes ( void  )
private

Definition at line 256 of file FurnaceRecipe.cpp.

◆ GetBurnTime()

int cFurnaceRecipe::GetBurnTime ( const cItem a_Fuel) const

Returns the amount of time that the specified fuel burns, in ticks.

Definition at line 322 of file FurnaceRecipe.cpp.

◆ GetRecipeFrom()

const cFurnaceRecipe::cRecipe * cFurnaceRecipe::GetRecipeFrom ( const cItem a_Ingredient) const

Returns a recipe for the specified input, nullptr if no recipe found.

Definition at line 281 of file FurnaceRecipe.cpp.

◆ IsFuel()

bool cFurnaceRecipe::IsFuel ( const cItem a_Item) const

Returns true if the item is a fuel, false if not.

Definition at line 306 of file FurnaceRecipe.cpp.

◆ ParseItem()

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

Parses an item string in the format "<ItemType>[: <Damage>][, <Amount>]", returns true if successful.

Definition at line 219 of file FurnaceRecipe.cpp.

◆ ReloadRecipes()

void cFurnaceRecipe::ReloadRecipes ( void  )

Definition at line 53 of file FurnaceRecipe.cpp.

Member Data Documentation

◆ m_pState

sFurnaceRecipeState* cFurnaceRecipe::m_pState
private

Definition at line 60 of file FurnaceRecipe.h.


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