-
Notifications
You must be signed in to change notification settings - Fork 1
/
doc-players.txt
68 lines (56 loc) · 3.84 KB
/
doc-players.txt
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
Every player needs some basic functionality for choosing cards and picking
which species board to feed next. This functionality is put into
basic-pplayer%
which also provides a basic equality implementation. The dealer needs to
make sure that it has complete knowledge of an external player's state and
its possibilities. This is dealt with in
player%
Finally, a player needs to implement strategies for starting a turn,
choosing card actions, and picking species boards. Those go into
external-player%
The
proxy-player%
bridges the gap between the dealer and an external player running on a
remote computer. Up to some pre-condition, it satisfies the same contract
and interface as external-player%.
+----------------------+ +----------------------+
| basic-player% |--- implements --> | equal<%> |
+----------------------+ +----------------------+
| store-fat |
| separate-hungries |
| with-fat-tissue |
| hungry |
| can-attack |
| can-attack+ |
+----------------------+
^
|
-----------------------------+-----------------------------
| |
+----------------------+ +----------------------+
| player% | +------------------> | external-player% |---satisfies---+
+----------------------+ | +----------------------+ |
| id, external |---- has -----+ | start | |
+----------------------+ | choose | |
| start | | feed-next | |
| choose | +----------------------+ |
| feed-next | * = (>= (length cards) CARDS-BEFORE-CHOOSE)
+----------------------+ +----------------------+ |
| add-board* | | (external-player/c *)| <-------------+
| replace-trait | +----------------------+ |
| grow-body* | |
| grow-population* | |
| card | * = true |
| remove-cards | +----------------------+ |
| all-fed | | proxy-player% | <------------ +
| feedable | +----------------------+
| feed1 | | start |
| attack! | | choose |
| population+1 | | feed-next |
| kill1 | +----------------------+
| add-board-if-needed |
| take-cards |
| how-many-cards-needed|
| move-food-to-bag |
| score |
+----------------------+