Added game files
This commit is contained in:
parent
704637d45e
commit
340b9b6900
31 changed files with 5427 additions and 0 deletions
35
source/Crafting.h
Normal file
35
source/Crafting.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
#include <stdarg.h>
|
||||
#include "Item.h"
|
||||
|
||||
typedef struct {
|
||||
int costItem;
|
||||
int costAmount;
|
||||
} Cost;
|
||||
|
||||
typedef struct {
|
||||
bool canCraft;
|
||||
int itemResult;
|
||||
int itemAmountLevel;
|
||||
s8 numOfCosts;
|
||||
Cost costs[6]; // Up to 6 items for costs
|
||||
u8 order; // Used for stable sorting.
|
||||
} Recipe;
|
||||
|
||||
typedef struct {
|
||||
int size;
|
||||
Recipe * recipes;
|
||||
} RecipeManager;
|
||||
|
||||
|
||||
RecipeManager workbenchRecipes;
|
||||
RecipeManager furnaceRecipes;
|
||||
RecipeManager ovenRecipes;
|
||||
RecipeManager anvilRecipes;
|
||||
|
||||
void checkCanCraftRecipes(RecipeManager * rm, Inventory * inv);
|
||||
void sortRecipes(RecipeManager * rm);
|
||||
bool craftItem(RecipeManager * rm, Recipe* r, Inventory* inv);
|
||||
|
||||
void initRecipes();
|
||||
void freeRecipes();
|
Loading…
Add table
Add a link
Reference in a new issue