Changeset 322


Ignore:
Timestamp:
Jun 25, 2024, 1:15:02 AM (11 days ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameSystem.pas

    r318 r322  
    55uses
    66  Classes, SysUtils, Generics.Collections, &Unit, DOM, XMLRead, XMLWrite, XML, XMLConf,
    7   FileUtil, LazFileUtils, MapType, Nation, Building;
     7  FileUtil, LazFileUtils, MapType, Nation, Building, ItemList;
    88
    99type
     
    6969begin
    7070  I := 0;
    71   while (I < Count) and (TGameSystem(Items[I]).GetName <> Name) do Inc(I);
     71  while (I < Count) and (Items[I].GetName <> Name) do Inc(I);
    7272  if I < Count then Result := Items[I]
    7373    else Result := nil;
  • trunk/Map.pas

    r317 r322  
    262262  I := 0;
    263263  while (I < Count) do begin
    264     if ((TCellLink(Items[I]).Cells[0] = Cell1) and (TCellLink(Items[I]).Cells[1] = Cell2)) or
    265     ((TCellLink(Items[I]).Cells[0] = Cell2) and (TCellLink(Items[I]).Cells[1] = Cell1)) then
     264    if ((Items[I].Cells[0] = Cell1) and (Items[I].Cells[1] = Cell2)) or
     265    ((Items[I].Cells[0] = Cell2) and (Items[I].Cells[1] = Cell1)) then
    266266      Break;
    267267    Inc(I);
    268268  end;
    269   if I < Count then Result := TCellLink(Items[I])
     269  if I < Count then Result := Items[I]
    270270    else Result := nil;
    271271end;
     
    308308begin
    309309  for I := 0 to Count - 1 do
    310   with TCellLink(Items[I]) do begin
     310  with Items[I] do begin
    311311    NewNode2 := Node.OwnerDocument.CreateElement('CellLink');
    312312    Node.AppendChild(NewNode2);
     
    545545procedure TMap.LoadFromFile(FileName: string);
    546546begin
    547 
    548547end;
    549548
    550549procedure TMap.SaveToFile(FileName: string);
    551550begin
    552 
    553551end;
    554552
     
    851849  if Areas.Count > 1 then
    852850  for I := 0 to Areas.Count - 1 do
    853   with TMapArea(Areas[I]) do begin
     851  with Areas[I] do begin
    854852    GetBorderCells(BorderList);
    855853    if BorderList.Count > 0 then
  • trunk/Player.pas

    r318 r322  
    12771277  with TGame(Game).Map do
    12781278  for I := 0 to Cells.Count - 1 do
    1279   with TCell(Cells[I]) do begin
     1279  with Cells[I] do begin
    12801280    if (Player = Self) and ((TGame(Game).GrowCells = gcPlayerAll) or
    12811281    ((TGame(Game).GrowCells = gcPlayerCities) and (Assigned(Building) and (Building.Kind.SpecialType = stCity)))) then begin
     
    12831283        NewUnit := TGame(Game).Units.AddNew(TUnitKind(TGame(Game).GameSystem.UnitKinds.First), 0);
    12841284        NewUnit.Player := Self;
    1285         NewUnit.MapCell := TCell(Cells[I]);
     1285        NewUnit.MapCell := Cells[I];
    12861286        Units.Add(NewUnit);
    12871287      end;
Note: See TracChangeset for help on using the changeset viewer.