#pragma once
#ifndef __CUSER_H__
#define __CUSER_H__

#pragma pack(push, 0x01)


class CUserCharacInfo
{
public:
	//获取角色名字
	std::string getCurCharacName()
	{
		typedef char* (*__func)(CUserCharacInfo* a1);
		return std::string(((__func)base::CUserCharacInfo::getCurCharacName)(this));
	}

	//获取角色编号
	int getCurCharacNo()
	{
		typedef int (*__func)(CUserCharacInfo* a1);
		return int(((__func)base::CUserCharacInfo::getCurCharacNo)(this));
	}

	//获取角色上次退出游戏时间
	int getCurCharacLastPlayTick()
	{
		typedef int (*__func)(CUserCharacInfo* a1);
		return int(((__func)base::CUserCharacInfo::getCurCharacLastPlayTick)(this));
	}

	//获取角色等级
	int get_level_up_exp(int a2)
	{
		typedef int (*__func)(CUserCharacInfo* a1, int a2);
		return int(((__func)base::CUserCharacInfo::get_level_up_exp)(this, a2));
	}

	//获取角色背包
	CInventory* getCurCharacInvenW()
	{
		typedef CInventory* (*__func)(CUserCharacInfo* a1);
		return ((__func)base::CUserCharacInfo::getCurCharacInvenW)(this);
	}

	bool _checkItemMovable(int a2, int a3, int a4, int a5, int a6, int a7)
	{
		CallT<bool>(base::CUserCharacInfo::_checkItemMovable, this, a2, a3, a4, a5, a6, a7);
	}

	CInventory* getCurCharacInvenR()
	{
		return CallT<CInventory*>(base::CUserCharacInfo::getCurCharacInvenR, this);
	}

	int getCurCharacR()
	{
		return CallT<int>(base::CUserCharacInfo::getCurCharacR, this);
	}

};

class CUser : public CUserCharacInfo
{
public:
	int get_state()
	{
		typedef int (*__func)(CUser* a1);
		return int(((__func)base::CUser::get_state)(this));
	}

	/**
	 * @brief 检查物品锁定
	 * @param a2 背包位置
	 * @param a3 物品栏位
	 * @return
	*/
	bool CheckItemLock(int a2, int a3)
	{
		typedef bool (*__func)(CUser* a1, int a2, int a3);
		return int(((__func)base::CUser::CheckItemLock)(this, a2, a3));
	}

	int SendNotiPacketMessage(char* a2, int a3)
	{
		typedef bool (*__func)(CUser* a1, char* a2, int a3);
		return int(((__func)base::CUser::SendNotiPacketMessage)(this, a2, a3));
	}

	//角色增加经验
	int gain_exp_sp(unsigned int a2, int a3, int a4, int a5, int a6, int a7)
	{
		typedef int (*__func)(CUserCharacInfo* a1, unsigned int a2, int a3, int a4, int a5, int a6, int a7);
		return int(((__func)base::CUser::gain_exp_sp)(this, a2, a3, a4, a5, a6, a7));
	}

	//发送道具
	int AddItem(int a2, int a3, int a4, int a5, int a6)
	{
		typedef int (*__func)(CUser* a1, int a2, int a3, int a4, int a5, int a6);
		return int(((__func)base::CUser::AddItem)(this, a2, a3, a4, a5, a6));
	}

	//通知客户端道具更新(客户端指针, 通知方式[仅客户端=1, 世界广播=0, 小队=2, war room=3], itemSpace[装备=0, 时装=1], 道具所在的背包槽)
	int SendUpdateItemList(int a2, int a3, int a4)
	{
		typedef int (*__func)(CUserCharacInfo* a1, int a2, int a3, int a4);
		return int(((__func)base::CUser::SendUpdateItemList)(this, a2, a3, a4));
	}

	int SendCmdErrorPacket(int packet_id, unsigned char a3)
	{
		typedef int (*__func)(CUser* a1, int a2, unsigned char a3);
		return int(((__func)base::CUser::SendCmdErrorPacket)(this, packet_id, a3));
	}

	int isEnableAvatarSocketAction()
	{
		typedef int (*__func)(CUser* a1);
		return int(((__func)base::CUser::isEnableAvatarSocketAction)(this));
	}

	int Send(PacketGuard* a2)
	{
		typedef int (*__func)(CUser* a1, PacketGuard* a2);
		return int(((__func)base::CUser::Send)(this, a2));
	}

	CUser* setLastPacketID(int a2)
	{
		return CallT<CUser*>(base::CUser::setLastPacketID, this, a2);
	}

	CAccountCargo* GetAccountCargo()
	{
		return CallT<CAccountCargo*>(base::CUser::GetAccountCargo, this);
	}

	int CheckInTrade()
	{
		return CallT<int>(base::CUser::CheckInTrade, this);
	}

	bool IsExistAccountCargo()
	{
		return CallT<bool>(base::CUser::IsExistAccountCargo, this);
	}

	int send_itemspace(int a2)
	{
		return CallT<bool>(base::CUser::send_itemspace, this, a2);
	}

};

#pragma pack(pop)

#endif // __CUSER_H__

