Ignore:
Timestamp:
Apr 6, 2021, 8:11:02 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Merged trunk branch version r348 into highdpi branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/ClientTools.pas

    r303 r349  
    1616  TEnhancementJobs = array [0 .. 11, 0 .. 7] of byte;
    1717  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;
    1834
    1935var
     
    5975procedure CityOptimizer_AfterRemoveUnit;
    6076procedure CityOptimizer_EndOfTurn;
     77function GetMyCityByLoc(Loc: Integer): PCity;
     78function GetEnemyCityByLoc(Loc: Integer): PCityInfo;
     79function GetMyUnitByLoc(Loc: Integer): PUn;
     80function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo;
    6181
    6282
     
    241261      Inc(Result, CityReport.FoodSurplus);
    242262  end;
    243   for i := 28 to nImp - 1 do
     263  for i := nWonder to nImp - 1 do
    244264    if MyCity[cix].Built[i] > 0 then
    245265      Dec(Result, Imp[i].Maint);
     
    696716end;
    697717
     718function GetMyCityByLoc(Loc: Integer): PCity;
     719var
     720  I: Integer;
     721begin
     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;
     726end;
     727
     728function GetEnemyCityByLoc(Loc: Integer): PCityInfo;
     729var
     730  I: Integer;
     731begin
     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;
     736end;
     737
     738function GetMyUnitByLoc(Loc: Integer): PUn;
     739var
     740  I: Integer;
     741begin
     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;
     746end;
     747
     748function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo;
     749var
     750  I: Integer;
     751begin
     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;
     756end;
     757
     758
    698759initialization
    699760
Note: See TracChangeset for help on using the changeset viewer.