Add api to get expedition's zone name

This commit is contained in:
hg 2020-09-22 22:46:35 -04:00
parent cbccd72050
commit 2c2c2ac5ee
2 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include "lua_expedition.h"
#include "expedition.h"
#include "zone_store.h"
#include "lua.hpp"
#include <luabind/luabind.hpp>
#include <luabind/object.hpp>
@ -125,6 +126,11 @@ int Lua_Expedition::GetZoneID() {
return self->GetDynamicZone().GetZoneID();
}
std::string Lua_Expedition::GetZoneName() {
Lua_Safe_Call_String();
return ZoneName(self->GetDynamicZone().GetZoneID());
}
int Lua_Expedition::GetZoneVersion() {
Lua_Safe_Call_Int();
return self->GetDynamicZone().GetZoneVersion();
@ -236,6 +242,7 @@ luabind::scope lua_register_expedition() {
.def("GetSecondsRemaining", (int(Lua_Expedition::*)(void))&Lua_Expedition::GetSecondsRemaining)
.def("GetUUID", (std::string(Lua_Expedition::*)(void))&Lua_Expedition::GetUUID)
.def("GetZoneID", (int(Lua_Expedition::*)(void))&Lua_Expedition::GetZoneID)
.def("GetZoneName", &Lua_Expedition::GetZoneName)
.def("GetZoneVersion", &Lua_Expedition::GetZoneVersion)
.def("HasLockout", (bool(Lua_Expedition::*)(std::string))&Lua_Expedition::HasLockout)
.def("HasReplayLockout", (bool(Lua_Expedition::*)(void))&Lua_Expedition::HasReplayLockout)

View File

@ -69,6 +69,7 @@ public:
int GetSecondsRemaining();
std::string GetUUID();
int GetZoneID();
std::string GetZoneName();
int GetZoneVersion();
bool HasLockout(std::string event_name);
bool HasReplayLockout();