1
0

Added the new recipe parser, parsing the crafting.txt file. Included are a few recipes. The old parser still works, but will be replaced soon.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@549 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-06-04 12:08:20 +00:00
parent ce5d97d65b
commit b355bdecce
21 changed files with 20029 additions and 18948 deletions

View File

@@ -7,30 +7,51 @@
#include <fstream>
#include <sstream>
typedef std::list< cFurnaceRecipe::Recipe > RecipeList;
typedef std::list< cFurnaceRecipe::Fuel > FuelList;
struct cFurnaceRecipe::sFurnaceRecipeState
{
RecipeList Recipes;
FuelList Fuel;
};
cFurnaceRecipe::cFurnaceRecipe()
: m_pState( new sFurnaceRecipeState )
{
ReloadRecipes();
}
cFurnaceRecipe::~cFurnaceRecipe()
{
ClearRecipes();
delete m_pState;
}
void cFurnaceRecipe::ReloadRecipes()
{
ClearRecipes();
LOG("--Loading furnace recipes--");
LOG("-- Loading furnace recipes --");
std::ifstream f;
char a_File[] = "furnace.txt";
@@ -152,9 +173,13 @@ void cFurnaceRecipe::ReloadRecipes()
}
LOG("Got %i furnace recipes, and %i fuels.", m_pState->Recipes.size(), m_pState->Fuel.size() );
LOG("--Done loading furnace recipes--");
LOG("-- Done loading furnace recipes --");
}
void cFurnaceRecipe::ClearRecipes()
{
for( RecipeList::iterator itr = m_pState->Recipes.begin(); itr != m_pState->Recipes.end(); ++itr )