forked from noah-/d2bs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJSRoom.h
58 lines (48 loc) · 2.8 KB
/
JSRoom.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
#ifndef ROOM_H
#define ROOM_H
#include "Room.h"
#include "js32.h"
CLASS_CTOR(room);
JSAPI_PROP(room_getProperty);
JSAPI_FUNC(room_getNext);
JSAPI_FUNC(room_getPresetUnits);
JSAPI_FUNC(room_getCollision);
JSAPI_FUNC(room_getCollisionTypeArray);
JSAPI_FUNC(room_getNearby);
JSAPI_FUNC(room_getStat);
JSAPI_FUNC(room_getFirst);
JSAPI_FUNC(room_unitInRoom);
JSAPI_FUNC(room_reveal);
JSAPI_FUNC(my_getRoom);
enum room_tinyid {
ROOM_NUM,
ROOM_XPOS,
ROOM_YPOS,
ROOM_XSIZE,
ROOM_YSIZE,
ROOM_SUBNUMBER,
ROOM_AREA,
ROOM_LEVEL,
ROOM_CORRECTTOMB,
};
static JSPropertySpec room_props[] = {{"number", ROOM_NUM, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"x", ROOM_XPOS, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"y", ROOM_YPOS, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"xsize", ROOM_XSIZE, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"ysize", ROOM_YSIZE, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"subnumber", ROOM_SUBNUMBER, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"area", ROOM_AREA, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"level", ROOM_LEVEL, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{"correcttomb", ROOM_CORRECTTOMB, JSPROP_PERMANENT_VAR, JSOP_WRAPPER(room_getProperty), JSOP_NULLWRAPPER},
{0, 0, 0, JSOP_NULLWRAPPER, JSOP_NULLWRAPPER}};
static JSFunctionSpec room_methods[] = {JS_FS("getNext", room_getNext, 0, FUNCTION_FLAGS),
JS_FS("reveal", room_reveal, 1, FUNCTION_FLAGS),
JS_FS("getPresetUnits", room_getPresetUnits, 0, FUNCTION_FLAGS),
JS_FS("getCollision", room_getCollision, 0, FUNCTION_FLAGS),
JS_FS("getCollisionA", room_getCollisionTypeArray, 0, FUNCTION_FLAGS),
JS_FS("getNearby", room_getNearby, 0, FUNCTION_FLAGS),
JS_FS("getStat", room_getStat, 0, FUNCTION_FLAGS),
JS_FS("getFirst", room_getFirst, 0, FUNCTION_FLAGS),
JS_FS("unitInRoom", room_unitInRoom, 1, FUNCTION_FLAGS),
JS_FS_END};
#endif