13 #include "../ChunkStay.h"
virtual ~cLuaChunkStay() override
cLuaState::cCallbackPtr m_OnChunkAvailable
The Lua function to call in OnChunkAvailable.
cLuaState::cCallbackPtr m_OnAllChunksAvailable
The Lua function to call in OnAllChunksAvailable.
bool AddChunks(const cLuaState::cStackTable &a_ChunkCoords)
Adds chunks in the specified Lua table.
void AddChunkCoord(cLuaState &a_LuaState, int a_Index)
Adds a single chunk coord from the table at the top of the Lua stack.
virtual void OnChunkAvailable(int a_ChunkX, int a_ChunkZ) override
Called when a specific chunk become available.
virtual bool OnAllChunksAvailable(void) override
Called once all of the contained chunks are available.
void Enable(cChunkMap &a_ChunkMap, cLuaState::cCallbackPtr a_OnChunkAvailable, cLuaState::cCallbackPtr a_OnAllChunksAvailable)
Enables the ChunkStay for the specified chunkmap, with the specified Lua callbacks.
virtual void OnDisabled(void) override
Called by the ChunkMap when the ChunkStay is disabled.
Encapsulates a Lua state and provides some syntactic sugar for common operations.
std::unique_ptr< cCallback > cCallbackPtr
Represents a table on the Lua stack.
Makes chunks stay loaded until this object is cleared or destroyed Works by setting internal flags in...