-
Notifications
You must be signed in to change notification settings - Fork 1
/
PlayerManager.oz
51 lines (51 loc) · 1.72 KB
/
PlayerManager.oz
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
functor
import
Player000bomber
%% Add here the name of the functor of a player
Player001Kardashian
Player001Tao
Player001Turing
Player001Dijkstra
Player055Clever
Player013smart
Player100advanced
Player038Luigi
Player100JonSnow
Player009defense
Player009notsafedefense
Player017advanced
Player010IA2
Player007Scared
Player055survivor
export
playerGenerator:PlayerGenerator
define
PlayerGenerator
in
fun{PlayerGenerator Kind ID}
case Kind
of player000bomber then {Player000bomber.portPlayer ID}
%% Add here the pattern to recognize the name used in the
%% input file and launch the portPlayer function from the functor
[] kardashian then {Player001Kardashian.portPlayer ID}
[] tao then {Player001Tao.portPlayer ID}
[] turing then {Player001Turing.portPlayer ID}
[] dijkstra then {Player001Dijkstra.portPlayer ID}
[] player055Clever then {Player055Clever.portPlayer ID}
[] player013smart then {Player013smart.portPlayer ID}
[] player100advanced then {Player100advanced.portPlayer ID}
[] player038Luigi then {Player038Luigi.portPlayer ID}
[] player100JonSnow then {Player100JonSnow.portPlayer ID}
[] player009defense then {Player009defense.portPlayer ID}
[] player009notsafedefense then {Player009notsafedefense.portPlayer ID}
[] player017advanced then {Player017advanced.portPlayer ID}
[] player010IA2 then {Player010IA2.portPlayer ID}
[] player007Scared then {Player007Scared.portPlayer ID}
[] player055survivor then {Player055survivor.portPlayer ID}
else
raise
unknownPlayer('Player not recognized by the PlayerManager '#Kind)
end
end
end
end