-
Notifications
You must be signed in to change notification settings - Fork 2
/
AtlasExtension.h
53 lines (42 loc) · 1.09 KB
/
AtlasExtension.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <string>
#include <list>
#include <windows.h>
#include "Table.h"
#include "GenericVariable.h"
const unsigned int MAX_RETURN_VAL = 3;
const unsigned int NO_ACTION = 0;
const unsigned int REPLACE_TEXT = 1;
const unsigned int WRITE_POINTER = 2;
typedef struct AtlasContext
{
unsigned int CurrentLine;
std::list<TBL_STRING> StringTable;
FILE* Target;
unsigned int ScriptPos;
unsigned int ScriptRemaining;
unsigned int PointerValue;
unsigned int PointerPosition;
unsigned int PointerSize;
} AtlasContext;
typedef unsigned int (*ExtensionFunction) (AtlasContext** Context);
class ExtensionManager
{
public:
ExtensionManager(VariableMap* Map);
bool LoadExtension(std::string& ExtId, std::string& ExtensionFile);
unsigned int ExecuteExtension(std::string& ExtId, std::string& FunctionName, AtlasContext** Context);
private:
VariableMap* VarMap;
};
class AtlasExtension
{
public:
AtlasExtension();
~AtlasExtension();
bool LoadExtension(std::string& ExtensionName);
bool IsLoaded();
ExtensionFunction GetFunction(std::string& FunctionName);
private:
HMODULE Extension;
};