#pragma once

#include "../../RoleData/RoleBaseDef.h"
#include "../NetWakerPGEnum.h"

//--------------------------------------------------------------------------------------
//通知Server取地上某一個物品並且把此物品放置於欄位何處
// Client -> Local
struct PG_Item_CtoL_GetGroundItem
{
    GamePGCommandEnum	Command;
    int					ItemID;				//辨識用
//    short				Type;				//(0 Body )
    short				Pos;				//物品放置的位置

    PG_Item_CtoL_GetGroundItem()
    {
        Command = EM_PG_Item_CtoL_GetGroundItem;
    }
};
//--------------------------------------------------------------------------------------
//通知client 端某物品放置於某欄位是否成功

enum ItemResult
{
	EM_Item_GetItemInBufferOK	= -1   ,
    EM_Item_ItemOK				=	0,
    EM_Item_GetGroundItemFailed	     ,
    EM_Item_DeleteItemFailed         ,
    EM_Item_GetItemInBufferFailed   ,
    EM_Item_ExchangeFieldFailed     ,
    EM_Item_ExchangeMoneyFailed     ,
    EM_Item_FORCE_DWORD   = 0x7fffffff ,
};

// Local -> Client
struct PG_Item_LtoC_GetItemResult
{
    GamePGCommandEnum	Command;
    ItemResult			Result;				//辨識用
	int					Count;				//堆入量(只有buffer堆入有效)

    PG_Item_LtoC_GetItemResult()
    {
        Command = EM_PG_Item_LtoC_GetItemResult;
    }
};
//--------------------------------------------------------------------------------------
//通知Client 清除所有的ItemBuffer資料
// Local -> Client
struct PG_Item_LtoC_ClsItemInBuffer
{
    GamePGCommandEnum	Command;

    PG_Item_LtoC_ClsItemInBuffer()
    {
        Command = EM_PG_Item_LtoC_ClsItemInBuffer;
    }
};
//--------------------------------------------------------------------------------------
//通知Client 有新的物品可以取
// Local -> Client
struct PG_Item_LtoC_NewItemInBuffer
{
    GamePGCommandEnum	Command;
    ItemFieldStruct		Item;

    PG_Item_LtoC_NewItemInBuffer()
    {
        Command = EM_PG_Item_LtoC_NewItemInBuffer;
    }
};
//--------------------------------------------------------------------------------------
//要求取Buf內的資料
// Client -> Local
struct PG_Item_CtoL_GetBufferItem
{
    GamePGCommandEnum	Command;
    ItemFieldStruct		Item;
 //   short				Type;				//(0 Body)
    short				Pos;				//物品放置的位置
    short               Count;

    PG_Item_CtoL_GetBufferItem()
    {
        Command = EM_PG_Item_CtoL_GetBufferItem;
    }
};
//--------------------------------------------------------------------------------------
//通知刪除某欄位物品
//如果為金錢則位置忽略
// Client -> Local
struct PG_Item_CtoL_DeleteItem
{
    GamePGCommandEnum	Command;
    ItemFieldStruct		Item;
    short				Type;				//(0 Body 1 Bank 2 BodyMoney 3 BankMoney)
    short				Pos;				//物品放置的位置


    PG_Item_CtoL_DeleteItem()
    {
        Command = EM_PG_Item_CtoL_DeleteItem;
    }
};
//--------------------------------------------------------------------------------------
//通知刪除某欄位物品
//如果為金錢則位置忽略
// Local -> Client
struct PG_Item_LtoC_DeleteItem
{
    GamePGCommandEnum	Command;
//    ItemFieldStruct		Item;
    short				Type;				//(0 Body 1 Bank 2 BodyMoney 3 BankMoney)
//    short				Pos;				//物品放置的位置
    ItemResult			Result;

    PG_Item_LtoC_DeleteItem()
    {
        Command = EM_PG_Item_LtoC_DeleteItem;
    }
};
//--------------------------------------------------------------------------------------
//要求兩物欄位品交換
// Client -> Local
struct	PG_Item_CtoL_ExchangeField
{
    GamePGCommandEnum	Command;
    ItemFieldStruct		Item[2];
    short				Type[2];			//(0 Body 1 Bank )
    short				Pos[2];				//物品放置的位置


    PG_Item_CtoL_ExchangeField()
    {
        Command = EM_PG_Item_CtoL_ExchangeField;
    }
};
//--------------------------------------------------------------------------------------
//回應兩物品欄位交換結果
// Local -> Client
struct	PG_Item_LtoC_ExchangeField
{
    GamePGCommandEnum	Command;
//    ItemFieldStruct		Item[2];	
    short				Type[2];			//(0 Body 1 Bank)
    //short				Pos[2];				//物品放置的位置
    ItemResult			Result;

    PG_Item_LtoC_ExchangeField()
    {
        Command = EM_PG_Item_LtoC_ExchangeField;
    }
};
//--------------------------------------------------------------------------------------
//要求兩物品欄位交換結果
// Client -> Local
struct	PG_Item_CtoL_RequestBodyBankMoneyExchange
{
    GamePGCommandEnum	Command;

    int					Count;		//身體加 銀行減


    PG_Item_CtoL_RequestBodyBankMoneyExchange()
    {
        Command = EM_PG_Item_CtoL_RequestBodyBankMoneyExchange;
    }
};

//--------------------------------------------------------------------------------------
//回應身體與銀行金錢交換
// Local -> Client
struct	PG_Item_LtoC_BodyBankMoneyExchange
{
    GamePGCommandEnum	Command;
    ItemResult			Result;

    PG_Item_LtoC_BodyBankMoneyExchange()
    {
        Command = EM_PG_Item_LtoC_BodyBankMoneyExchange;
    }
};
//--------------------------------------------------------------------------------------
//要求重送Buffer內的資料
// Client -> Local
struct	PG_Item_CtoL_RequestBufferInfo
{
    GamePGCommandEnum	Command;

    PG_Item_CtoL_RequestBufferInfo()
    {
        Command = EM_PG_Item_CtoL_RequestBufferInfo;
    }
};
//--------------------------------------------------------------------------------------
//要求把身體某欄位分成兩半
// Client -> Server
struct	PG_Item_CtoL_RequestApartBodyItem
{
    GamePGCommandEnum	Command;
    ItemFieldStruct		Item;
    short				PosSrc;
    short				CountDes; 
    short				PosDes;

    PG_Item_CtoL_RequestApartBodyItem()
    {
        Command = EM_PG_Item_CtoL_RequestApartBodyItem;
    }
};
//--------------------------------------------------------------------------------------
//修正某一位置的資料
// Local -> Client
struct	PG_Item_LtoC_FixItemInfo
{
    GamePGCommandEnum	Command;
    ItemFieldStruct		Item;
    short				Type;				//(0 Body 1 Bank 2 BodyMoney 3 BankMoney)
    short				Pos;				//物品放置的位置

    PG_Item_LtoC_FixItemInfo()
    {
        Command = EM_PG_Item_LtoC_FixItemInfo;
    }
};
//--------------------------------------------------------------------------------------
//要求修正所有物品更新
//Client -> Server
struct	PG_Item_CtoL_RequestFixAllItemInfo
{
    GamePGCommandEnum	Command;

    PG_Item_CtoL_RequestFixAllItemInfo()
    {
        Command = EM_PG_Item_CtoL_RequestFixAllItemInfo;
    }
};
//--------------------------------------------------------------------------------------
//修正所有物品更新
//Local -> Client
struct	PG_Item_LtoC_FixAllItemInfo
{
    GamePGCommandEnum	Command;

    ItemStruct          Body;
    ItemStruct          Bank;
    EQStruct			EQ;

    PG_Item_LtoC_FixAllItemInfo()
    {
        Command = EM_PG_Item_LtoC_FixAllItemInfo;
    }
};
//--------------------------------------------------------------------------------------
//修正身體 銀行金錢
//Local -> Client
struct  PG_Item_LtoC_FixMoney
{
    GamePGCommandEnum	Command;

    int					BodyMoney;
    int					BankMoney;

    PG_Item_LtoC_FixMoney()
    {
        Command = EM_PG_Item_LtoC_FixMoney;
    }
};
//--------------------------------------------------------------------------------------

//通知目前包裹與銀行欄位的上線量
//Local -> Client
struct  PG_Item_LtoC_MaxItemCount
{
    GamePGCommandEnum	Command;

    int					MaxBody;		//身體欄位上限
    int					MaxBank;		//銀行欄位上限

    PG_Item_LtoC_MaxItemCount()
    {
        Command = EM_PG_Item_LtoC_MaxItemCount;
    }
};
//--------------------------------------------------------------------------------------
//通知開啟銀行
//Local  -> Client
struct  PG_Item_LtoC_OpenBank
{
    GamePGCommandEnum	Command;
	int					GItemID;	//銀行的物件id

    PG_Item_LtoC_OpenBank()
    {
        Command = EM_PG_Item_LtoC_OpenBank;
    }
};
//--------------------------------------------------------------------------------------
//通知關閉銀行
//Client -> Local
struct  PG_Item_CtoL_CloseBank
{
    GamePGCommandEnum	Command;

    PG_Item_CtoL_CloseBank()
    {
        Command = EM_PG_Item_CtoL_CloseBank;
    }
};
//--------------------------------------------------------------------------------------
//通知關閉銀行
//Client -> Local
struct  PG_Item_LtoC_CloseBank
{
	GamePGCommandEnum	Command;

	PG_Item_LtoC_CloseBank()
	{
		Command = EM_PG_Item_LtoC_CloseBank;
	}
};
//--------------------------------------------------------------------------------------
//要求使用物品
//Client -> Local
struct PG_Item_CtoL_UseItem
{
    GamePGCommandEnum	Command;
    int 				Pos;				//物品放置的位置
    int 				TargetID;
    ItemFieldStruct		Item;
    short				Type;				//(0 Body 1 Bank 2 EQ)
	float				TargetX , TargetY , TargetZ;

    PG_Item_CtoL_UseItem()
    {
        Command = EM_PG_Item_CtoL_UseItem;
    }
};
//--------------------------------------------------------------------------------------
//物品使用結果
//Local -> Client
struct PG_Item_LtoC_UseItemResult
{
    GamePGCommandEnum	Command;

    bool		Result;		// false 失敗 true 成功
    short		Pos;		//物品位置
    short		Type;		//(0 Body 1 Bank 2 EQ)

    PG_Item_LtoC_UseItemResult()
    {
        Command = EM_PG_Item_LtoC_UseItemResult;
    }
};
//--------------------------------------------------------------------------------------
//修正重要物品的旗標
//Local -> Client
struct PG_Item_LtoC_SetKeyItemFlag
{
	GamePGCommandEnum	Command;
	
	int		KeyItemID;
	bool	Value;

	PG_Item_LtoC_SetKeyItemFlag()
	{
		Command = EM_PG_Item_LtoC_SetKeyItemFlag;
	}
};
//--------------------------------------------------------------------------------------