#pragma once

#include "PG_Recipe.h"
#include "../../MainProc/NetGlobal.h"

class NetCli_Recipe : public CNetGlobal
{
protected:
    //-------------------------------------------------------------------
    static	NetCli_Recipe* This;
    static	bool _Init();
    static	bool _Release();	
    
	static void _PG_Recipe_LtoC_LockResourceAndRefineResult ( int Sockid , int Size , void* Data );     
	static void _PG_Recipe_LtoC_ProduceItemResult			( int Sockid , int Size , void* Data );     


protected:
	static vector<ItemFieldStruct> _ItemList;
	//要求鎖住某個配方單( Client 端)
	static bool LockRecipeResource( int Recipe );
	//要求解開配方單鎖住的物品( Client 端)
	static void UnlockRecipeResource( );

public:    
    NetCli_Recipe() { This = this; }

	static	NetCli_Recipe*	GetThis()						{ return This; }

	//要求合成物品 
	static bool SL_RefineItem( int RecipeID );

	//合成成功 ItemList 為合成出的物品
	virtual void RL_LockResourceAndRefineResultOK( int RecipeID ,vector<ItemFieldStruct>& ItemList  ) = 0;

	//合成失敗 ItemList 為消耗的物品
	virtual void RL_LockResourceAndRefineResultFailed( int RecipeID , vector<ItemFieldStruct>& ItemList  ) = 0;

	//合成條件不符合
	virtual void RL_LockResourceAndRefineResultError( int RecipeID , RefineResultENUM	Result ) = 0;
};

