Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <CraftingRecipes.h>
Classes | |
struct | cRecipe |
A single recipe, stored. More... | |
struct | cRecipeSlot |
Public Member Functions | |
cCraftingRecipes (void) | |
void | GetRecipe (cPlayer &a_Player, cCraftingGrid &a_CraftingGrid, cCraftingRecipe &a_Recipe) |
Returns the recipe for current crafting grid. More... | |
~cCraftingRecipes () | |
Static Public Attributes | |
static const int | MAX_GRID_HEIGHT = 3 |
static const int | MAX_GRID_WIDTH = 3 |
Protected Types | |
typedef std::vector< cRecipe * > | cRecipes |
typedef std::vector< cRecipeSlot > | cRecipeSlots |
Protected Member Functions | |
void | AddRecipeLine (int a_LineNum, const AString &a_RecipeLine) |
Parses the recipe line and adds it into m_Recipes. More... | |
void | ClearRecipes (void) |
cRecipe * | FindRecipe (const cItem *a_CraftingGrid, int a_GridWidth, int a_GridHeight) |
Finds a recipe matching the crafting grid. More... | |
cRecipe * | FindRecipeCropped (const cItem *a_CraftingGrid, int a_GridWidth, int a_GridHeight, int a_GridStride) |
Same as FindRecipe, but the grid is guaranteed to be of minimal dimensions needed. More... | |
void | HandleDyedLeather (const cItem *a_CraftingGrid, cCraftingRecipes::cRecipe *a_Recipe, int a_GridStride, int a_GridWidth, int a_GridHeight) |
Searches for anything dye related for leather, calculates the appropriate color value, and sets the resulting value. More... | |
void | HandleFireworks (const cItem *a_CraftingGrid, cCraftingRecipes::cRecipe *a_Recipe, int a_GridStride, int a_OffsetX, int a_OffsetY) |
Searches for anything firework related, and does the data setting if appropriate. More... | |
void | LoadRecipes (void) |
cRecipe * | MatchRecipe (const cItem *a_CraftingGrid, int a_GridWidth, int a_GridHeight, int a_GridStride, const cRecipe *a_Recipe, int a_OffsetX, int a_OffsetY) |
Checks if the grid matches the specified recipe, offset by the specified offsets. More... | |
void | NormalizeIngredients (cRecipe *a_Recipe) |
Moves the recipe to top-left corner, sets its MinWidth / MinHeight. More... | |
bool | ParseIngredient (const AString &a_String, cRecipe *a_Recipe) |
Parses one ingredient and adds it to the specified recipe. More... | |
bool | ParseItem (const AString &a_String, cItem &a_Item) |
Parses an item string in the format "<ItemType>[^<Damage>]", returns true if successful. More... | |
Protected Attributes | |
cRecipes | m_Recipes |
Definition at line 108 of file CraftingRecipes.h.
|
protected |
Definition at line 140 of file CraftingRecipes.h.
|
protected |
Definition at line 127 of file CraftingRecipes.h.
cCraftingRecipes::cCraftingRecipes | ( | void | ) |
Definition at line 272 of file CraftingRecipes.cpp.
cCraftingRecipes::~cCraftingRecipes | ( | ) |
Definition at line 281 of file CraftingRecipes.cpp.
|
protected |
Parses the recipe line and adds it into m_Recipes.
a_LineNum is used for diagnostic warnings only
Definition at line 375 of file CraftingRecipes.cpp.
|
protected |
Definition at line 362 of file CraftingRecipes.cpp.
|
protected |
Finds a recipe matching the crafting grid.
Returns a newly allocated recipe (with all its coords set) or nullptr if not found. Caller must delete return value!
Definition at line 591 of file CraftingRecipes.cpp.
|
protected |
Same as FindRecipe, but the grid is guaranteed to be of minimal dimensions needed.
Definition at line 634 of file CraftingRecipes.cpp.
void cCraftingRecipes::GetRecipe | ( | cPlayer & | a_Player, |
cCraftingGrid & | a_CraftingGrid, | ||
cCraftingRecipe & | a_Recipe | ||
) |
Returns the recipe for current crafting grid.
Doesn't modify the grid. Clears a_Recipe if no recipe found.
Definition at line 290 of file CraftingRecipes.cpp.
|
protected |
Searches for anything dye related for leather, calculates the appropriate color value, and sets the resulting value.
Definition at line 882 of file CraftingRecipes.cpp.
|
protected |
Searches for anything firework related, and does the data setting if appropriate.
Definition at line 801 of file CraftingRecipes.cpp.
|
protected |
Definition at line 321 of file CraftingRecipes.cpp.
|
protected |
Checks if the grid matches the specified recipe, offset by the specified offsets.
Returns a matched cRecipe * if so, or nullptr if not matching. Caller must delete the return value!
Definition at line 664 of file CraftingRecipes.cpp.
|
protected |
Moves the recipe to top-left corner, sets its MinWidth / MinHeight.
Definition at line 550 of file CraftingRecipes.cpp.
Parses one ingredient and adds it to the specified recipe.
Returns true if successful.
Definition at line 474 of file CraftingRecipes.cpp.
Parses an item string in the format "<ItemType>[^<Damage>]", returns true if successful.
Definition at line 441 of file CraftingRecipes.cpp.
|
protected |
Definition at line 142 of file CraftingRecipes.h.
|
static |
Definition at line 112 of file CraftingRecipes.h.
|
static |
Definition at line 111 of file CraftingRecipes.h.