Changeset 155 for trunk/UGame.pas
- Timestamp:
- Nov 16, 2017, 12:43:42 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r154 r155 444 444 procedure CalculatePlayersDistance; 445 445 procedure PropagatePlayerDistance(List: TCells); 446 procedure InitDefaultPlayers ;446 procedure InitDefaultPlayersSetting; 447 447 public 448 448 Players: TPlayers; 449 PlayersSetting: TPlayers; 449 450 Clients: TClients; 450 451 Map: TMap; … … 3084 3085 end; 3085 3086 3086 procedure TGame.InitDefaultPlayers ;3087 begin 3088 Players .Clear;3089 Players .New(SPlayer + ' 1', clBlue, pmHuman);3090 Players .New(SPlayer + ' 2', clRed, pmComputer);3087 procedure TGame.InitDefaultPlayersSetting; 3088 begin 3089 PlayersSetting.Clear; 3090 PlayersSetting.New(SPlayer + ' 1', clBlue, pmHuman); 3091 PlayersSetting.New(SPlayer + ' 2', clRed, pmComputer); 3091 3092 end; 3092 3093 … … 3109 3110 SetValue(DOMString(Path + '/GrowCells'), Integer(GrowCells)); 3110 3111 SetValue(DOMString(Path + '/WinObjective'), Integer(WinObjective)); 3111 Players .SaveConfig(Config, Path + '/Players');3112 PlayersSetting.SaveConfig(Config, Path + '/Players'); 3112 3113 end; 3113 3114 end; … … 3141 3142 if (Value >= Integer(Low(TWinObjective))) and (Value <= Integer(High(TWinObjective))) then 3142 3143 WinObjective := TWinObjective(Value) else WinObjective := Low(TWinObjective); 3143 Players .LoadConfig(Config, Path + '/Players');3144 PlayersSetting.LoadConfig(Config, Path + '/Players'); 3144 3145 end; 3145 3146 end; … … 3367 3368 Players := TPlayers.Create; 3368 3369 Players.Game := Self; 3370 PlayersSetting := TPlayers.Create; 3371 PlayersSetting.Game := Self; 3369 3372 Clients := TClients.Create; 3370 3373 Clients.Game := Self; … … 3372 3375 MapImageFileName := 'Images/Maps/WorldMap.png'; 3373 3376 Randomize; 3377 InitDefaultPlayersSetting; 3374 3378 3375 3379 VoidEnabled := True; … … 3384 3388 begin 3385 3389 FreeAndNil(Clients); 3390 FreeAndNil(PlayersSetting); 3386 3391 FreeAndNil(Players); 3387 3392 FreeAndNil(Map); … … 3430 3435 end; 3431 3436 3432 InitDefaultPlayers;3437 Players.Assign(PlayersSetting); 3433 3438 for Player in Players do Player.StartCell := nil; 3434 3439 I := 0;
Note:
See TracChangeset
for help on using the changeset viewer.