Ignore:
Timestamp:
Mar 23, 2021, 10:49:30 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r324 r325  
    1515  TIsoMap = class
    1616  private
     17    const
     18      Dirx: array [0..7] of Integer = (1, 2, 1, 0, -1, -2, -1, 0);
     19      Diry: array [0..7] of Integer = (-1, 0, 1, 2, 1, 0, -1, -2);
    1720    procedure CityGrid(xm, ym: integer; CityAllowClick: Boolean);
    1821    function IsShoreTile(Loc: integer): boolean;
     
    753756      (MyMap[dLoc(Loc, -2, 2)] and fObserved <> 0) and
    754757      (MyMap[dLoc(Loc, 2, 2)] and fObserved <> 0) then
    755       result := result or fObserved
     758      result := result or fObserved;
    756759  end
    757760  else if Loc < 0 then
     
    762765    if (MyMap[dLoc(Loc, -1, 1)] and fObserved <> 0) and
    763766      (MyMap[dLoc(Loc, 1, 1)] and fObserved <> 0) then
    764       result := result or fObserved
     767      result := result or fObserved;
    765768  end
    766769  else if Loc < G.lx * (G.ly + 1) then
     
    771774    if (MyMap[dLoc(Loc, -1, -1)] and fObserved <> 0) and
    772775      (MyMap[dLoc(Loc, 1, -1)] and fObserved <> 0) then
    773       result := result or fObserved
     776      result := result or fObserved;
    774777  end
    775778  else if Loc < G.lx * (G.ly + 2) then
     
    782785      (MyMap[dLoc(Loc, -2, -2)] and fObserved <> 0) and
    783786      (MyMap[dLoc(Loc, 2, -2)] and fObserved <> 0) then
    784       result := result or fObserved
    785   end
    786 end;
    787 
    788 const
    789   Dirx: array [0 .. 7] of integer = (1, 2, 1, 0, -1, -2, -1, 0);
    790   Diry: array [0 .. 7] of integer = (-1, 0, 1, 2, 1, 0, -1, -2);
     787      result := result or fObserved;
     788  end;
     789end;
    791790
    792791function TIsoMap.Connection4(Loc, Mask, Value: integer): integer;
     
    811810function TIsoMap.Connection8(Loc, Mask: integer): integer;
    812811var
    813   Dir, ConnLoc: integer;
     812  Dir: Integer;
     813  ConnLoc: Integer;
    814814begin
    815815  result := 0;
     
    825825function TIsoMap.OceanConnection(Loc: integer): integer;
    826826var
    827   Dir, ConnLoc: integer;
     827  Dir: Integer;
     828  ConnLoc: Integer;
    828829begin
    829830  result := 0;
     
    839840procedure TIsoMap.PaintShore(x, y, Loc: integer);
    840841var
    841   Conn, Tile: integer;
     842  Conn: Integer;
     843  Tile: Integer;
    842844begin
    843845  if (y <= FTop - yyt * 2) or (y > FBottom) or (x <= FLeft - xxt * 2) or
     
    13331335
    13341336function TIsoMap.IsShoreTile(Loc: integer): boolean;
    1335 const
    1336   Dirx: array [0 .. 7] of integer = (1, 2, 1, 0, -1, -2, -1, 0);
    1337   Diry: array [0 .. 7] of integer = (-1, 0, 1, 2, 1, 0, -1, -2);
    1338 var
    1339   Dir, ConnLoc: integer;
     1337var
     1338  Dir: Integer;
     1339  ConnLoc: integer;
    13401340begin
    13411341  result := false;
     
    13451345    if (ConnLoc < 0) or (ConnLoc >= G.lx * G.ly) or
    13461346      ((MyMap[ConnLoc] - 2) and fTerrain < 13) then
    1347       result := true
    1348   end
     1347      result := true;
     1348  end;
    13491349end;
    13501350
Note: See TracChangeset for help on using the changeset viewer.