Changeset 486 for trunk/AI/StdAI
- Timestamp:
- Dec 8, 2023, 8:25:31 PM (12 months ago)
- Location:
- trunk/AI/StdAI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/AI.pas
r447 r486 2566 2566 if (Loc >= 0) and (Flags and chCaptured = 0) and (District[Loc] >= 0) then 2567 2567 begin 2568 if size < 4 then2568 if Size < 4 then 2569 2569 City_OptimizeTiles(cix, rwMaxGrowth) 2570 2570 else -
trunk/AI/StdAI/Barbarina.pas
r447 r486 1431 1431 (iix = imShipComp) or (iix = imShipPow) or (iix = imShipHab) then 1432 1432 City_OptimizeTiles(cix, rwMaxProd) 1433 else if size < 8 then1433 else if Size < 8 then 1434 1434 City_OptimizeTiles(cix, rwMaxGrowth) 1435 1435 else -
trunk/AI/StdAI/Pile.pas
r447 r486 43 43 if (N <> 0) or (Size > CurrentSize) then 44 44 begin 45 FillChar(Ix, Size * sizeOf(Integer), 255);45 FillChar(Ix, Size * SizeOf(Integer), 255); 46 46 N := 0; 47 47 end; 48 48 CurrentSize := Size; 49 49 {$IFDEF DEBUG} 50 50 InUse := True; 51 51 {$ENDIF} … … 54 54 procedure Free; 55 55 begin 56 56 {$IFDEF DEBUG} 57 57 Assert(InUse); 58 58 InUse := False; … … 64 64 if N <> 0 then 65 65 begin 66 FillChar(Ix, CurrentSize * sizeOf(Integer), 255);66 FillChar(Ix, CurrentSize * SizeOf(Integer), 255); 67 67 N := 0; 68 68 end; 69 69 end; 70 70 71 // Parent(i) = (i-1)/2.72 function Put(Item, Value: Integer): Boolean; // O(lg(n))71 // Parent(i) = (i-1)/2. 72 function Put(Item, Value: Integer): Boolean; // O(lg(n)) 73 73 var 74 74 I, J: Integer; … … 92 92 while I > 0 do 93 93 begin 94 J := (I - 1) shr 1; // Parent(i) = (i-1)/294 J := (I - 1) shr 1; // Parent(i) = (i-1)/2 95 95 if Value >= bh[J].Value then 96 96 Break; … … 99 99 I := J; 100 100 end; 101 // 101 // Insert the new Item at the insertion point found. 102 102 bh[I].Value := Value; 103 103 bh[I].Item := Item;
Note:
See TracChangeset
for help on using the changeset viewer.