add lua engine, lua file, server, client, vehicle data, other stuff

This commit is contained in:
Lion Kortlepel
2021-02-15 02:35:15 +01:00
committed by Anonymous275
parent e5e447c7af
commit 459814a6ec
21 changed files with 1538 additions and 15 deletions

32
include/TLuaEngine.h Normal file
View 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