Changeset 298 for trunk/UCore.pas
- Timestamp:
- Jul 10, 2019, 5:35:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r292 r298 531 531 procedure TCore.LoadGame(FileName: string); 532 532 var 533 Player: TPlayer;533 I: Integer; 534 534 NewClient: TClient; 535 535 ServerClient: TServerClient; 536 Player: TPlayer; 536 537 begin 537 538 GameLoaded := True; … … 544 545 LocalClients.Clear; 545 546 FormClient.Client := nil; 546 for Player in Game.Players do 547 with Player do 548 if Mode = pmHuman then begin 549 NewClient := LocalClients.New(Name); 550 NewClient.ControlPlayer := Player; 551 TClientGUI(NewClient).View.Clear; 552 TClientGUI(NewClient).View.Zoom := 1; 553 NewClient.LocalServer := Server; 554 NewClient.ConnectType := ctLocal; 555 NewClient.Active := True; 556 if Assigned(NewClient.ControlPlayer.StartCell) then 557 TClientGUI(NewClient).View.CenterPlayerCity(NewClient.ControlPlayer) 558 else TClientGUI(NewClient).View.CenterMap; 559 end else 560 if Mode = pmComputer then begin 561 NewClient := TComputer.Create; 562 NewClient.Game := TGame(Game); 563 NewClient.Name := Name; 564 LocalClients.Add(NewClient); 565 NewClient.ControlPlayer := Player; 566 NewClient.LocalServer := Server; 567 NewClient.ConnectType := ctLocal; 568 NewClient.Active := True; 547 for I := 0 to Game.Players.Count - 1 do begin 548 Player := TPlayer(Game.Players[I]); 549 with Player do 550 if Mode = pmHuman then begin 551 NewClient := LocalClients.New(Name); 552 NewClient.ControlPlayer := Player; 553 TClientGUI(NewClient).View.Clear; 554 TClientGUI(NewClient).View.Zoom := 1; 555 NewClient.LocalServer := Server; 556 NewClient.ConnectType := ctLocal; 557 NewClient.Active := True; 558 if Assigned(NewClient.ControlPlayer.StartCell) then 559 TClientGUI(NewClient).View.CenterPlayerCity(NewClient.ControlPlayer) 560 else TClientGUI(NewClient).View.CenterMap; 561 end else 562 if Mode = pmComputer then begin 563 NewClient := TComputer.Create; 564 NewClient.Game := TGame(Game); 565 NewClient.Name := Name; 566 LocalClients.Add(NewClient); 567 NewClient.ControlPlayer := Player; 568 NewClient.LocalServer := Server; 569 NewClient.ConnectType := ctLocal; 570 NewClient.Active := True; 571 end; 569 572 end; 570 573 … … 650 653 NewClient: TClient; 651 654 Player: TPlayer; 655 I: Integer; 652 656 ServerClient: TServerClient; 653 657 begin … … 659 663 LocalClients.Clear; 660 664 FormClient.Client := nil; 661 for Player in Game.Players do 662 with Player do 663 if Mode = pmHuman then begin 664 NewClient := LocalClients.New(Name); 665 NewClient.ControlPlayer := Player; 666 TClientGUI(NewClient).View.Clear; 667 TClientGUI(NewClient).View.Zoom := 1; 668 NewClient.LocalServer := Server; 669 NewClient.ConnectType := ctLocal; 670 NewClient.Active := True; 671 if Assigned(NewClient.ControlPlayer.StartCell) then 672 TClientGUI(NewClient).View.CenterPlayerCity(NewClient.ControlPlayer) 673 else TClientGUI(NewClient).View.CenterMap; 674 end else 675 if Mode = pmComputer then begin 676 NewClient := TComputer.Create; 677 NewClient.Game := TGame(Game); 678 NewClient.Name := Name; 679 LocalClients.Add(NewClient); 680 NewClient.ControlPlayer := Player; 681 NewClient.LocalServer := Server; 682 NewClient.ConnectType := ctLocal; 683 NewClient.Active := True; 665 for I := 0 to Game.Players.Count - 1 do begin 666 Player := TPlayer(Game.Players[I]); 667 with Player do 668 if Mode = pmHuman then begin 669 NewClient := LocalClients.New(Name); 670 NewClient.ControlPlayer := Player; 671 TClientGUI(NewClient).View.Clear; 672 TClientGUI(NewClient).View.Zoom := 1; 673 NewClient.LocalServer := Server; 674 NewClient.ConnectType := ctLocal; 675 NewClient.Active := True; 676 if Assigned(NewClient.ControlPlayer.StartCell) then 677 TClientGUI(NewClient).View.CenterPlayerCity(NewClient.ControlPlayer) 678 else TClientGUI(NewClient).View.CenterMap; 679 end else 680 if Mode = pmComputer then begin 681 NewClient := TComputer.Create; 682 NewClient.Game := TGame(Game); 683 NewClient.Name := Name; 684 LocalClients.Add(NewClient); 685 NewClient.ControlPlayer := Player; 686 NewClient.LocalServer := Server; 687 NewClient.ConnectType := ctLocal; 688 NewClient.Active := True; 689 end; 684 690 end; 685 691
Note:
See TracChangeset
for help on using the changeset viewer.