Repository navigation
Expand file tree
/
Copy pathexample.dc
More file actions
45 lines (38 loc) · 1.33 KB
/
Copy pathexample.dc
File metadata and controls
45 lines (38 loc) · 1.33 KB
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
// Some abstractions for readability.
typedef uint32 doId;
typedef uint32 zoneId;
typedef uint64 channel;
// The Python Views for these distributed classes.
from example_views import PointOfContact/UD
from example_views import GameRoot/AI/AE
from example_views import LoginService/AI/AE
from example_views import World/AI/AE
from example_views import AIServer/AI/AE
from example_views import Avatar/AI/AE/OV
// A simple DOG for username/password authentication and handoff to
// the DistributedMaproot for avatar creation.
dclass PointOfContact {
login(string username, string password) clsend airecv;
};
// The root of the visibility tree, a container for services and
// top-level stuff.
dclass GameRoot {};
// The user authentication service.
dclass LoginService {
login(channel client, string username, string password) airecv;
}
// FIXME: Comment
dclass World {
create_avatar(channel client) airecv;
};
// The root object of the map, container for the DistributedAvatars.
dclass AIServer {
};
// The actual class for avatar control.
// The idea is that a Client can set its intention for its heading
// and speed, but only the controlling AI can set its actual
// position and heading.
dclass Avatar {
setXYZH(int16 / 1000, int16 / 1000, int16 / 1000, int16 / 50) broadcast required;
indicateIntent(int16 / 10, int16 / 10) ownsend airecv;
};