Files
vcmi/scripting/lua/api/netpacks/PackForClient.h
T

46 lines
721 B
C++
Raw Normal View History

2018-03-17 17:58:30 +03:00
/*
* api/netpacks/PackForClient.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../../LuaWrapper.h"
#include "../../../../lib/NetPacks.h"
namespace scripting
{
namespace api
{
namespace netpacks
{
template <typename Derived>
class PackForClientProxy
{
public:
2021-02-16 17:07:30 +03:00
static int toNetpackLight(lua_State * L)
2018-03-17 17:58:30 +03:00
{
2021-02-16 17:07:30 +03:00
typename Derived::UDataType object;
LuaStack S(L);
if(!S.tryGet(1, object))
return S.retVoid();
2018-03-17 17:58:30 +03:00
lua_settop(L, 0);
lua_pushlightuserdata(L, static_cast<CPackForClient *>(object.get()));
return 1;
}
};
}
}
}