Bazaar developer reference

CvLuaPlayer::lGetMilitaryLog(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 9187
Class
CvLuaPlayer
Not a hook point
member without a separate declaration

Code

9187int CvLuaPlayer::lGetMilitaryLog(lua_State* L)9188{9189	CvPlayerAI* pkPlayer = GetInstance(L);91909191	lua_createtable(L, 0, 0);9192	int index = 1;91939194	CvEventLog* pMilitaryLog = pkPlayer->GetMilitaryLog();9195	for (int i = 0; i < pMilitaryLog->GetNumEvents(); i++)9196	{9197		lua_createtable(L, 0, 0);9198		const int t = lua_gettop(L);91999200		lua_pushinteger(L, pMilitaryLog->GetTurn(i));9201		lua_setfield(L, t, "Turn");9202		lua_pushstring(L, pMilitaryLog->GetMessage(i));9203		lua_setfield(L, t, "Message");9204		lua_pushinteger(L, pMilitaryLog->GetOtherPlayer(i));9205		lua_setfield(L, t, "OtherPlayer");9206		CvLuaPlot::Push(L, pMilitaryLog->GetPlot(i));9207		lua_setfield(L, t, "Plot");9208		lua_pushinteger(L, pMilitaryLog->GetData1(i));9209		lua_setfield(L, t, "Data1");9210		lua_pushinteger(L, pMilitaryLog->GetData2(i));9211		lua_setfield(L, t, "Data2");9212		lua_pushinteger(L, pMilitaryLog->GetData3(i));9213		lua_setfield(L, t, "Data3");9214		lua_pushinteger(L, pMilitaryLog->GetData4(i));9215		lua_setfield(L, t, "Data4");92169217		lua_rawseti(L, -2, index++);9218	}92199220	return 1;9221}

Calls

Called by