#include "../netwaker_member/NetWakerClientInc.h"
#include "MoneyFrame.h"

CMoneyFrame*				g_pMoneyFrame = NULL;

int LuaFunc_GetPlayerMoney				(lua_State* L);

// ----------------------------------------------------------------------------
CMoneyFrame::CMoneyFrame(CInterface* object)
	: CInterfaceBase(object)
{
	g_pMoneyFrame = this;
}

// ----------------------------------------------------------------------------
CMoneyFrame::~CMoneyFrame()
{
	g_pMoneyFrame = NULL;
}

// ----------------------------------------------------------------------------
void CMoneyFrame::RegisterFunc()
{
	lua_State* L = GetLuaStateWorld();
	if (L)
	{
		lua_register(L, "GetPlayerMoney",					LuaFunc_GetPlayerMoney);
	}
}

// ----------------------------------------------------------------------------
int LuaFunc_GetPlayerMoney(lua_State* L)
{
	lua_pushnumber(L, CNetGlobal::RoleData()->BodyMoney());
	return 1;
}