-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol.wit
53 lines (40 loc) · 1.35 KB
/
protocol.wit
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
package liquislime:protocol;
interface types {
record time-interval {
fragments: s64
}
record slime-amount {
amount: s64,
}
record tile-position {
x: s32,
y: s32,
}
record position {
x: float32,
y: float32,
}
record faction {
id: u8,
}
enum mouse-input {
primary
}
}
world liquislime-unit {
import types;
//use liquislime:protocol/types.{time-interval, slime-amount, tile-position, position, faction, mouse-input};
use types.{time-interval, slime-amount, tile-position, position, faction, mouse-input};
import level-width: func() -> s32;
import level-height: func() -> s32;
import get-own-position: func() -> tile-position;
import get-own-faction: func() -> faction;
import get-slime-amount: func(faction: faction, position: tile-position) -> slime-amount;
import set-slime-amount: func(faction: faction, position: tile-position, amount: slime-amount);
import get-mouse-position: func() -> option<position>;
import is-mouse-pressed: func(input: mouse-input) -> bool;
export describe-settings: func() -> string;
export init: func(settings: string) -> result<_, string>;
export change-settings: func(settings: string) -> result<_, string>;
export update: func(time-elapsed: time-interval);
}