Changeset 486 for trunk/AI


Ignore:
Timestamp:
Dec 8, 2023, 8:25:31 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk/AI/StdAI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/AI/StdAI/AI.pas

    r447 r486  
    25662566      if (Loc >= 0) and (Flags and chCaptured = 0) and (District[Loc] >= 0) then
    25672567      begin
    2568         if size < 4 then
     2568        if Size < 4 then
    25692569          City_OptimizeTiles(cix, rwMaxGrowth)
    25702570        else
  • trunk/AI/StdAI/Barbarina.pas

    r447 r486  
    14311431            (iix = imShipComp) or (iix = imShipPow) or (iix = imShipHab) then
    14321432            City_OptimizeTiles(cix, rwMaxProd)
    1433           else if size < 8 then
     1433          else if Size < 8 then
    14341434            City_OptimizeTiles(cix, rwMaxGrowth)
    14351435          else
  • trunk/AI/StdAI/Pile.pas

    r447 r486  
    4343  if (N <> 0) or (Size > CurrentSize) then
    4444  begin
    45     FillChar(Ix, Size * sizeOf(Integer), 255);
     45    FillChar(Ix, Size * SizeOf(Integer), 255);
    4646    N := 0;
    4747  end;
    4848  CurrentSize := Size;
    49         {$IFDEF DEBUG}
     49{$IFDEF DEBUG}
    5050  InUse := True;
    5151{$ENDIF}
     
    5454procedure Free;
    5555begin
    56         {$IFDEF DEBUG}
     56{$IFDEF DEBUG}
    5757  Assert(InUse);
    5858  InUse := False;
     
    6464  if N <> 0 then
    6565  begin
    66     FillChar(Ix, CurrentSize * sizeOf(Integer), 255);
     66    FillChar(Ix, CurrentSize * SizeOf(Integer), 255);
    6767    N := 0;
    6868  end;
    6969end;
    7070
    71 //Parent(i) = (i-1)/2.
    72 function Put(Item, Value: Integer): Boolean; //O(lg(n))
     71// Parent(i) = (i-1)/2.
     72function Put(Item, Value: Integer): Boolean; // O(lg(n))
    7373var
    7474  I, J: Integer;
     
    9292  while I > 0 do
    9393  begin
    94     J := (I - 1) shr 1;  //Parent(i) = (i-1)/2
     94    J := (I - 1) shr 1;  // Parent(i) = (i-1)/2
    9595    if Value >= bh[J].Value then
    9696      Break;
     
    9999    I := J;
    100100  end;
    101   //  Insert the new Item at the insertion point found.
     101  // Insert the new Item at the insertion point found.
    102102  bh[I].Value := Value;
    103103  bh[I].Item := Item;
Note: See TracChangeset for help on using the changeset viewer.