mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-23 00:28:08 +02:00
.github
AI
CI
Mods
android
client
cmake_modules
config
debian
docs
include
ios
launcher
lib
lib_server
mapeditor
osx
rpm
scripting
erm
lua
api
battle
events
AdventureEvents.cpp
AdventureEvents.h
BattleEvents.cpp
BattleEvents.h
EventBusProxy.cpp
EventBusProxy.h
GenericEvents.cpp
GenericEvents.h
SubscriptionRegistryProxy.cpp
SubscriptionRegistryProxy.h
netpacks
Artifact.cpp
Artifact.h
BattleCb.cpp
BattleCb.h
BonusSystem.cpp
BonusSystem.h
Creature.cpp
Creature.h
Faction.cpp
Faction.h
GameCb.cpp
GameCb.h
HeroClass.cpp
HeroClass.h
HeroInstance.cpp
HeroInstance.h
HeroType.cpp
HeroType.h
ObjectInstance.cpp
ObjectInstance.h
Player.cpp
Player.h
Registry.cpp
Registry.h
ServerCb.cpp
ServerCb.h
Services.cpp
Services.h
Skill.cpp
Skill.h
Spell.cpp
Spell.h
StackInstance.cpp
StackInstance.h
CMakeLists.txt
Lua.cbp
LuaCallWrapper.h
LuaFunctor.h
LuaReference.cpp
LuaReference.h
LuaScriptModule.cpp
LuaScriptModule.h
LuaScriptingContext.cpp
LuaScriptingContext.h
LuaSpellEffect.cpp
LuaSpellEffect.h
LuaStack.cpp
LuaStack.h
LuaWrapper.h
StdInc.cpp
StdInc.h
scripts
server
test
win
xcode
.gitattributes
.gitignore
.gitmodules
.travis.yml
AUTHORS.h
CCallback.cpp
CCallback.h
CMakeLists.txt
CMakePresets.json
ChangeLog.md
Global.h
VCMI_VS15.sln
VCMI_global.props
VCMI_global_debug.props
VCMI_global_release.props
VCMI_global_user.props
Version.cpp.in
Version.h
conanfile.py
fuzzylite.pc.in
license.txt
vcmi.workspace
vcmibuilder
93 lines
1.9 KiB
C++
93 lines
1.9 KiB
C++
/*
|
|
* GenericEvents.cpp, 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
|
|
*
|
|
*/
|
|
#include "StdInc.h"
|
|
|
|
#include "GenericEvents.h"
|
|
|
|
#include "../../LuaStack.h"
|
|
#include "../../LuaCallWrapper.h"
|
|
#include "../Registry.h"
|
|
#include "SubscriptionRegistryProxy.h"
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
namespace scripting
|
|
{
|
|
namespace api
|
|
{
|
|
namespace events
|
|
{
|
|
using ::events::GameResumed;
|
|
using ::events::PlayerGotTurn;
|
|
using ::events::TurnStarted;
|
|
|
|
VCMI_REGISTER_SCRIPT_API(GameResumedProxy, "events.GameResumed");
|
|
VCMI_REGISTER_SCRIPT_API(PlayerGotTurnProxy, "events.PlayerGotTurn");
|
|
VCMI_REGISTER_SCRIPT_API(TurnStartedProxy, "events.TurnStarted");
|
|
|
|
const std::vector<GameResumedProxy::CustomRegType> GameResumedProxy::REGISTER_CUSTOM =
|
|
{
|
|
{
|
|
"subscribeBefore",
|
|
&SubscriptionRegistryProxy<GameResumedProxy>::subscribeBefore,
|
|
true
|
|
},
|
|
{
|
|
"subscribeAfter",
|
|
&SubscriptionRegistryProxy<GameResumedProxy>::subscribeAfter,
|
|
true
|
|
}
|
|
};
|
|
|
|
const std::vector<PlayerGotTurnProxy::CustomRegType> PlayerGotTurnProxy::REGISTER_CUSTOM =
|
|
{
|
|
{
|
|
"subscribeBefore",
|
|
&SubscriptionRegistryProxy<PlayerGotTurnProxy>::subscribeBefore,
|
|
true
|
|
},
|
|
{
|
|
"subscribeAfter",
|
|
&SubscriptionRegistryProxy<PlayerGotTurnProxy>::subscribeAfter,
|
|
true
|
|
},
|
|
{
|
|
"getPlayer",
|
|
LuaMethodWrapper<PlayerGotTurn, decltype(&PlayerGotTurn::getPlayerIndex), &PlayerGotTurn::getPlayerIndex>::invoke,
|
|
false
|
|
},
|
|
{
|
|
"setPlayer",
|
|
LuaMethodWrapper<PlayerGotTurn, decltype(&PlayerGotTurn::setPlayerIndex), &PlayerGotTurn::setPlayerIndex>::invoke,
|
|
false
|
|
},
|
|
};
|
|
|
|
const std::vector<TurnStartedProxy::CustomRegType> TurnStartedProxy::REGISTER_CUSTOM =
|
|
{
|
|
{
|
|
"subscribeBefore",
|
|
&SubscriptionRegistryProxy<TurnStartedProxy>::subscribeBefore,
|
|
true
|
|
},
|
|
{
|
|
"subscribeAfter",
|
|
&SubscriptionRegistryProxy<TurnStartedProxy>::subscribeAfter,
|
|
true
|
|
}
|
|
};
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|