changeset 2716 | b9ca1bfca24f |
parent 2695 | ed789a7ef68d |
child 2948 | 3f21a9dc93d0 |
2715:0e4e0db79e2a | 2716:b9ca1bfca24f |
---|---|
20 |
20 |
21 unit uAI; |
21 unit uAI; |
22 interface |
22 interface |
23 uses uFloat; |
23 uses uFloat; |
24 |
24 |
25 procedure init_uAI; |
|
26 procedure free_uAI; |
|
27 |
|
25 procedure ProcessBot; |
28 procedure ProcessBot; |
26 procedure FreeActionsList; |
29 procedure FreeActionsList; |
27 |
30 |
28 implementation |
31 implementation |
29 uses uTeams, uConsts, SDLh, uAIMisc, uGears, uAIAmmoTests, uAIActions, uMisc, |
32 uses uTeams, uConsts, SDLh, uAIMisc, uGears, uAIAmmoTests, uAIActions, uMisc, |
31 |
34 |
32 var BestActions: TActions; |
35 var BestActions: TActions; |
33 CanUseAmmo: array [TAmmoType] of boolean; |
36 CanUseAmmo: array [TAmmoType] of boolean; |
34 StopThinking: boolean; |
37 StopThinking: boolean; |
35 ThinkThread: TThreadID; |
38 ThinkThread: TThreadID; |
36 hasThread: LongInt = 0; |
39 hasThread: LongInt; |
37 |
40 |
38 procedure FreeActionsList; |
41 procedure FreeActionsList; |
39 begin |
42 begin |
40 {$IFDEF DEBUGFILE}AddFileLog('FreeActionsList called');{$ENDIF} |
43 {$IFDEF DEBUGFILE}AddFileLog('FreeActionsList called');{$ENDIF} |
41 if hasThread <> 0 then |
44 if hasThread <> 0 then |
340 end else ProcessAction(BestActions, Gear) |
343 end else ProcessAction(BestActions, Gear) |
341 else if ((GameTicks - StartTicks) > cMaxAIThinkTime) |
344 else if ((GameTicks - StartTicks) > cMaxAIThinkTime) |
342 or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true |
345 or (TurnTimeLeft <= cStopThinkTime) then StopThinking:= true |
343 end; |
346 end; |
344 |
347 |
348 procedure init_uAI; |
|
349 begin |
|
350 hasThread:= 0; |
|
351 end; |
|
352 |
|
353 procedure free_uAI; |
|
354 begin |
|
355 |
|
356 end; |
|
357 |
|
345 end. |
358 end. |