mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-02-16 10:41:01 +00:00
add lua engine, lua file, server, client, vehicle data, other stuff
This commit is contained in:
committed by
Anonymous275
parent
e5e447c7af
commit
459814a6ec
32
include/TLuaEngine.h
Normal file
32
include/TLuaEngine.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef TLUAENGINE_H
|
||||
#define TLUAENGINE_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "IThreaded.h"
|
||||
#include <lua.hpp>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
class TLuaFile;
|
||||
|
||||
class TLuaEngine : public IThreaded {
|
||||
public:
|
||||
using TSetOfLuaFile = std::set<std::unique_ptr<TLuaFile>>;
|
||||
|
||||
TLuaEngine();
|
||||
|
||||
virtual void operator()() override;
|
||||
|
||||
const TSetOfLuaFile& LuaFiles() const { return _LuaFiles; }
|
||||
|
||||
std::optional<std::reference_wrapper<TLuaFile>> GetScript(lua_State* L);
|
||||
|
||||
private:
|
||||
void FolderList(const std::string& Path, bool HotSwap);
|
||||
void RegisterFiles(const std::string& Path, bool HotSwap);
|
||||
bool NewFile(const std::string& Path);
|
||||
|
||||
TSetOfLuaFile _LuaFiles;
|
||||
};
|
||||
|
||||
#endif // TLUAENGINE_H
|
||||
Reference in New Issue
Block a user