Changeset 349 for branches/highdpi/LocalPlayer/ClientTools.pas
- Timestamp:
- Apr 6, 2021, 8:11:02 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/LocalPlayer/ClientTools.pas
r303 r349 16 16 TEnhancementJobs = array [0 .. 11, 0 .. 7] of byte; 17 17 JobResultSet = set of 0 .. 39; 18 19 TMapOption = ( 20 // options switched by buttons 21 moPolitical = 0, moCityNames = 1, moGreatWall = 4, moGrid = 5, moBareTerrain = 6, 22 // other options 23 moEditMode = 16, moLocCodes = 17 24 ); 25 TMapOptions = set of TMapOption; 26 27 TSaveOption = (soAlEffectiveMovesOnly = 0, soEnMoves = 1, soEnAttacks = 2, 28 soEnNoMoves = 3, soWaitTurn = 4, soEffectiveMovesOnly = 5, soEnFastMoves = 6, 29 soSlowMoves = 7, soFastMoves = 8, soVeryFastMoves = 9, soNames = 10, 30 soRepList = 11, soRepScreens = 12, soSoundOff = 13, soSoundOn = 14, 31 soSoundOnAlt = 15, soScrollSlow = 16, soScrollFast = 17, soScrollOff = 18, 32 soAlSlowMoves = 19, soAlFastMoves = 20, somAlNoMoves = 21, soTellAI = 30); 33 TSaveOptions = set of TSaveOption; 18 34 19 35 var … … 59 75 procedure CityOptimizer_AfterRemoveUnit; 60 76 procedure CityOptimizer_EndOfTurn; 77 function GetMyCityByLoc(Loc: Integer): PCity; 78 function GetEnemyCityByLoc(Loc: Integer): PCityInfo; 79 function GetMyUnitByLoc(Loc: Integer): PUn; 80 function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo; 61 81 62 82 … … 241 261 Inc(Result, CityReport.FoodSurplus); 242 262 end; 243 for i := 28to nImp - 1 do263 for i := nWonder to nImp - 1 do 244 264 if MyCity[cix].Built[i] > 0 then 245 265 Dec(Result, Imp[i].Maint); … … 696 716 end; 697 717 718 function GetMyCityByLoc(Loc: Integer): PCity; 719 var 720 I: Integer; 721 begin 722 I := MyRO.nCity - 1; 723 while (I >= 0) and (MyCity[I].Loc <> Loc) do Dec(I); 724 if I >= 0 then Result := @MyCity[I] 725 else Result := nil; 726 end; 727 728 function GetEnemyCityByLoc(Loc: Integer): PCityInfo; 729 var 730 I: Integer; 731 begin 732 I := MyRO.nEnemyCity - 1; 733 while (I >= 0) and (MyRo.EnemyCity[I].Loc <> Loc) do Dec(I); 734 if I >= 0 then Result := @MyRo.EnemyCity[I] 735 else Result := nil; 736 end; 737 738 function GetMyUnitByLoc(Loc: Integer): PUn; 739 var 740 I: Integer; 741 begin 742 I := MyRO.nUn - 1; 743 while (I >= 0) and (MyUn[I].Loc <> Loc) do Dec(I); 744 if I >= 0 then Result := @MyUn[I] 745 else Result := nil; 746 end; 747 748 function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo; 749 var 750 I: Integer; 751 begin 752 I := MyRO.nEnemyUn - 1; 753 while (I >= 0) and (MyRO.EnemyUn[I].Loc <> Loc) do Dec(I); 754 if I >= 0 then Result := @MyRO.EnemyUn[I] 755 else Result := nil; 756 end; 757 758 698 759 initialization 699 760
Note:
See TracChangeset
for help on using the changeset viewer.