-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extension.h
78 lines (48 loc) · 1.79 KB
/
Extension.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include <vector>
class Extension
{
public:
LPRDATA rdPtr;
LPRH rhPtr;
Edif::Runtime Runtime;
static const int MinimumBuild = 251;
static const int Version = 1;
static const int OEFLAGS = 0;
static const int OEPREFS = 0;
static const int WindowProcPriority = 100;
Extension(LPRDATA rdPtr, LPEDATA edPtr, fpcob cobPtr);
~Extension();
/* Add any data you want to store in your extension to this class
(eg. what you'd normally store in rdPtr)
Unlike rdPtr, you can store real C++ objects with constructors
and destructors, without having to call them manually or store
a pointer.
*/
std::vector<RunObject*> AttachedObjects;
/* Add your actions, conditions and expressions as real class member
functions here. The arguments (and return type for expressions) must
match EXACTLY what you defined in the JSON.
Remember to link the actions, conditions and expressions to their
numeric IDs in the class constructor (Extension.cpp)
*/
/// Actions
void AttachObjects(RunObject* Object);
void Update();
/// Conditions
/// Expressions
int NumObjects();
/* These are called if there's no function linked to an ID */
void Action(int ID, LPRDATA rdPtr, long param1, long param2);
long Condition(int ID, LPRDATA rdPtr, long param1, long param2);
long Expression(int ID, LPRDATA rdPtr, long param);
/* These replace the functions like HandleRunObject that used to be
implemented in Runtime.cpp. They work exactly the same, but they're
inside the extension class.
*/
short Handle();
short Display();
short Pause();
short Continue();
bool Save(HANDLE File);
bool Load(HANDLE File);
};