-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHttpRequest.reds
54 lines (46 loc) · 1.3 KB
/
HttpRequest.reds
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
public native class HttpRequest extends IScriptable {
public native func open(method: String, url: String, handler: ref<IScriptable>) -> Bool;
}
public class ResponseAddress extends IScriptable {
let address: Int32;
let street: String;
}
public class ResponseMeta extends IScriptable {
let name: String;
let pop: Int32;
let rate: Float;
let nested: ref<ResponseAddress>;
}
public class ResponseSchema extends IScriptable {
let string: String;
let numberInt: Int32;
let numberUInt: Uint32;
let numberInt64: Int64;
let numberUInt64: Uint64;
let numberFloat: Float;
let numberDouble: Double;
let numberFloatBig: Float;
let numberDoubleBig: Double;
let boolean: Bool;
let strings: array<String>;
let bools: array<Bool>;
let ints: array<Int32>;
let ints64: array<Int64>;
let floats: array<Float>;
let doubles: array<Double>;
let variants: array<Variant>;
let meta: ref<ResponseMeta>;
}
public class LevelSchema extends IScriptable {
let label: String;
let level: ref<LevelSchema>;
}
public class ExampleSystem extends ScriptableSystem {
public func OnAttach() -> Void {
let c = new HttpRequest();
let s = new LevelSchema();
s.level = new LevelSchema();
c.open("GET", "http://2077.johnsolo.net/sample.json", s);
Log("LevelSchema: s.label " + ToString(s.label));
}
}