equal
deleted
inserted
replaced
|
1 unit uFLTeams; |
|
2 interface |
|
3 uses uFLTypes; |
|
4 |
|
5 function createRandomTeam: TTeam; |
|
6 procedure sendTeamConfig(var team: TTeam); |
|
7 |
|
8 |
|
9 implementation |
|
10 uses uFLUtils, uFLIPC; |
|
11 |
|
12 function createRandomTeam: TTeam; |
|
13 var t: TTeam; |
|
14 i: Longword; |
|
15 begin |
|
16 with t do |
|
17 begin |
|
18 teamName:= 'team' + inttostr(random(100)); |
|
19 |
|
20 for i:= 0 to 7 do |
|
21 with hedgehogs[i] do |
|
22 begin |
|
23 name:= 'hedgehog ' + inttostr(i); |
|
24 hat:= 'NoHat' |
|
25 end; |
|
26 |
|
27 botLevel:= 0; |
|
28 hogsNumber:= 4 |
|
29 end; |
|
30 createRandomTeam:= t |
|
31 end; |
|
32 |
|
33 procedure sendTeamConfig(var team: TTeam); |
|
34 var i: Longword; |
|
35 begin |
|
36 with team do |
|
37 begin |
|
38 ipcToEngine('eaddteam <hash> ' + color + ' ' + teamName); |
|
39 for i:= 0 to Pred(hogsNumber) do |
|
40 begin |
|
41 ipcToEngine('eaddhh ' + inttostr(botLevel) + ' 100 ' + hedgehogs[i].name); |
|
42 ipcToEngine('ehat ' + hedgehogs[i].hat); |
|
43 end; |
|
44 end |
|
45 end; |
|
46 |
|
47 end. |