Ignore:
Timestamp:
Jan 7, 2024, 10:24:51 PM (4 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
  • Added: High DPI aware SetWindowPos function.
File:
1 edited

Legend:

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

    r447 r522  
    246246procedure ab_to_V8(A, B: Integer; var V8: Integer);
    247247begin
    248   Assert((abs(A) <= 1) and (abs(B) <= 1) and ((A <> 0) or (B <> 0)));
     248  Assert((Abs(A) <= 1) and (Abs(B) <= 1) and ((A <> 0) or (B <> 0)));
    249249  V8 := ab_v8[2 * B + B + A];
    250250end;
     
    373373begin
    374374  Loc_to_ab(Loc0, Loc1, A, B);
    375   dx := abs(A - B);
    376   dy := abs(A + B);
    377   Result := dx + dy + abs(dx - dy) shr 1;
    378 end;
    379 
     375  dx := Abs(A - B);
     376  dy := Abs(A + B);
     377  Result := dx + dy + Abs(dx - dy) shr 1;
     378end;
    380379
    381380procedure Init(NewGameData: TNewGameData);
     
    392391{$ENDIF}
    393392end;
    394 
    395393
    396394constructor TCustomAI.Create(Nation: Integer);
     
    410408  Server(sSetDebugMap, Me, 0, nodata^);
    411409end;
    412 
    413410
    414411procedure TCustomAI.Process(Command: Integer; var Data);
     
    495492            begin
    496493              Inc(Count);
    497               if random(Count) = 0 then
     494              if Random(Count) = 0 then
    498495                NewResearch := ad;
    499496            end;
     
    623620      begin
    624621        Inc(Count);
    625         if random(Count) = 0 then
     622        if Random(Count) = 0 then
    626623          Steal := ad;
    627624      end;
     
    11091106end;
    11101107
    1111 
    11121108// negotiation
    11131109function TCustomAI.Nego_CheckMyAction: Integer;
     
    11221118end;
    11231119
    1124 
    11251120initialization
    11261121  nodata := Pointer(0);
Note: See TracChangeset for help on using the changeset viewer.