Changeset 326 for trunk/LocalPlayer/ClientTools.pas
- Timestamp:
- Mar 24, 2021, 12:08:28 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/ClientTools.pas
r294 r326 59 59 procedure CityOptimizer_AfterRemoveUnit; 60 60 procedure CityOptimizer_EndOfTurn; 61 function GetMyCityByLoc(Loc: Integer): PCity; 62 function GetEnemyCityByLoc(Loc: Integer): PCityInfo; 63 function GetMyUnitByLoc(Loc: Integer): PUn; 64 function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo; 61 65 62 66 … … 696 700 end; 697 701 702 function GetMyCityByLoc(Loc: Integer): PCity; 703 var 704 I: Integer; 705 begin 706 I := MyRO.nCity - 1; 707 while (I >= 0) and (MyCity[I].Loc <> Loc) do Dec(I); 708 if I >= 0 then Result := @MyCity[I] 709 else Result := nil; 710 end; 711 712 function GetEnemyCityByLoc(Loc: Integer): PCityInfo; 713 var 714 I: Integer; 715 begin 716 I := MyRO.nEnemyCity - 1; 717 while (I >= 0) and (MyRo.EnemyCity[I].Loc <> Loc) do Dec(I); 718 if I >= 0 then Result := @MyRo.EnemyCity[I] 719 else Result := nil; 720 end; 721 722 function GetMyUnitByLoc(Loc: Integer): PUn; 723 var 724 I: Integer; 725 begin 726 I := MyRO.nUn - 1; 727 while (I >= 0) and (MyUn[I].Loc <> Loc) do Dec(I); 728 if I >= 0 then Result := @MyUn[I] 729 else Result := nil; 730 end; 731 732 function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo; 733 var 734 I: Integer; 735 begin 736 I := MyRO.nEnemyUn - 1; 737 while (I >= 0) and (MyRO.EnemyUn[I].Loc <> Loc) do Dec(I); 738 if I >= 0 then Result := @MyRO.EnemyUn[I] 739 else Result := nil; 740 end; 741 742 698 743 initialization 699 744
Note:
See TracChangeset
for help on using the changeset viewer.