Changeset 152 for trunk/Forms/UFormNew.pas
- Timestamp:
- Nov 15, 2017, 6:19:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormNew.pas
r151 r152 333 333 334 334 procedure TFormNew.Load(Game: TGame); 335 var336 I: Integer;337 335 begin 338 336 CheckBoxSymetricMap.Checked := Game.SymetricMap; … … 340 338 SpinEditVoidPercent.Value := Game.VoidPercentage; 341 339 SpinEditVoidPercent.Enabled := Game.VoidEnabled; 342 for I := 0 to Players.Count - 1 do 343 Players[I] := nil; 344 Players.Count := Game.Players.Count; 345 for I := 0 to Game.Players.Count - 1 do begin 346 Players[I] := TPlayer.Create; 347 TPlayer(Players[I]).Assign(TPlayer(Game.Players[I])); 348 end; 349 Players.NewPlayerId := Game.Players.NewPlayerId; 350 340 Players.Assign(Game.Players); 351 341 CheckBoxCity.Checked := Game.CityEnabled; 352 342 SpinEditCityPercent.Value := Game.CityPercentage; … … 367 357 368 358 procedure TFormNew.Save(Game: TGame); 369 var 370 I: Integer; 371 begin 372 while Game.Players.Count > Players.Count do 373 Game.Players.Delete(Game.Players.Count - 1); 374 while Game.Players.Count < Players.Count do 375 Game.Players.Add(TPlayer.Create); 376 for I := 0 to Game.Players.Count - 1 do begin 377 TPlayer(Game.Players[I]).Assign(TPlayer(Players[I])); 378 TPlayer(Game.Players[I]).Game := Game; 379 end; 359 begin 360 Game.Players.Assign(Players); 380 361 Game.Players.NewPlayerId := Players.NewPlayerId; 381 362 Game.SymetricMap := CheckBoxSymetricMap.Checked;
Note:
See TracChangeset
for help on using the changeset viewer.