Bazaar developer reference

CvLuaPlayer::lUnits(lua_State *)

Defined in
Lua/CvLuaPlayer.cpp, line 7892
Class
CvLuaPlayer
Hook name
CivHooks::CvLuaPlayer_lUnits

Hooks

static bool BeforeCvLuaPlayer_lUnits(lua_State* L, int& result);static void AfterCvLuaPlayer_lUnits(lua_State* L, int& result);static int ReplaceCvLuaPlayer_lUnits(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaPlayer_lUnits>(host, &BeforeCvLuaPlayer_lUnits);CivRegisterAfter<CivHooks::CvLuaPlayer_lUnits>(host, &AfterCvLuaPlayer_lUnits);CivRegisterReplace<CivHooks::CvLuaPlayer_lUnits>(host, &ReplaceCvLuaPlayer_lUnits);

Code

7891// Method for iterating through units (behaves like pairs)7892int CvLuaPlayer::lUnits(lua_State* L)7893{7894	lua_createtable(L, 1, 0);7895	lua_pushcclosure(L, lUnitsAux, 1);		/* generator, */7896	lua_pushvalue(L, 1);					/* state (self)*/7897	return 2;7898}

Calls

Called by