From 97eda34a9437abe732cf6b60711828bbe4f0cb2e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 16 Jun 2013 20:24:07 +0000 Subject: Rewritten furnaces Furnaces now smelt the correct number of items. Furnaces store their contents in a cItemGrid. Furnace window is updated with correct items and progressbars. Furnace recipes now use ticks instead of milliseconds. Furnaces save and load their state completely, not missing a smelt operation. Hoppers take items out of furnaces. Dropped the cSlotAreaDropSpenser class, replaced it with generic cSlotAreaItemGrid git-svn-id: http://mc-server.googlecode.com/svn/trunk@1601 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/FurnaceRecipe.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'source/FurnaceRecipe.h') diff --git a/source/FurnaceRecipe.h b/source/FurnaceRecipe.h index ccb008604..2f91e9bcb 100644 --- a/source/FurnaceRecipe.h +++ b/source/FurnaceRecipe.h @@ -14,31 +14,35 @@ class cItem; class cFurnaceRecipe { public: - cFurnaceRecipe(); + cFurnaceRecipe(void); ~cFurnaceRecipe(); - void ReloadRecipes(); + void ReloadRecipes(void); struct Fuel { - cItem* In; - float BurnTime; + cItem * In; + int BurnTime; ///< How long this fuel burns, in ticks }; struct Recipe { - cItem* In; - cItem* Out; - float CookTime; + cItem * In; + cItem * Out; + int CookTime; ///< How long this recipe takes to smelt, in ticks }; - const Recipe* GetRecipeFrom( const cItem & a_Ingredient ) const; - float GetBurnTime( const cItem & a_Fuel ) const; + + /// Returns a recipe for the specified input, NULL if no recipe found + const Recipe * GetRecipeFrom(const cItem & a_Ingredient) const; + + /// Returns the amount of time that the specified fuel burns, in ticks + int GetBurnTime(const cItem & a_Fuel) const; private: - void ClearRecipes(); + void ClearRecipes(void); struct sFurnaceRecipeState; - sFurnaceRecipeState* m_pState; + sFurnaceRecipeState * m_pState; }; -- cgit v1.2.3