Ignore:
Timestamp:
Mar 24, 2021, 12:08:28 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Mini map paint method moved from TMainScreen class to TMiniMap class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/ClientTools.pas

    r294 r326  
    5959procedure CityOptimizer_AfterRemoveUnit;
    6060procedure CityOptimizer_EndOfTurn;
     61function GetMyCityByLoc(Loc: Integer): PCity;
     62function GetEnemyCityByLoc(Loc: Integer): PCityInfo;
     63function GetMyUnitByLoc(Loc: Integer): PUn;
     64function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo;
    6165
    6266
     
    696700end;
    697701
     702function GetMyCityByLoc(Loc: Integer): PCity;
     703var
     704  I: Integer;
     705begin
     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;
     710end;
     711
     712function GetEnemyCityByLoc(Loc: Integer): PCityInfo;
     713var
     714  I: Integer;
     715begin
     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;
     720end;
     721
     722function GetMyUnitByLoc(Loc: Integer): PUn;
     723var
     724  I: Integer;
     725begin
     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;
     730end;
     731
     732function GetEnemyUnitByLoc(Loc: Integer): PUnitInfo;
     733var
     734  I: Integer;
     735begin
     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;
     740end;
     741
     742
    698743initialization
    699744
Note: See TracChangeset for help on using the changeset viewer.