Changeset 208 for trunk/UGame.pas


Ignore:
Timestamp:
May 22, 2018, 10:10:54 AM (6 years ago)
Author:
chronos
Message:
  • Added: Show number of captured win objective cells in players stats and graphs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UGame.pas

    r205 r208  
    278278    DiscoveredCells: Integer;
    279279    Cities: Integer;
     280    WinObjectiveCells: Integer;
    280281    procedure LoadFromNode(Node: TDOMNode);
    281282    procedure SaveToNode(Node: TDOMNode);
     
    320321    TotalCities: Integer;
    321322    TotalDiscovered: Integer;
     323    TotalWinObjectiveCells: Integer;
    322324    StartUnits: Integer;
    323325    StartCell: TCell;
     
    541543  DiscoveredCells := ReadInteger(Node, 'DiscoveredCells', 0);
    542544  Cities := ReadInteger(Node, 'Cities', 0);
     545  WinObjectiveCells := ReadInteger(Node, 'WinObjectiveCells', 0);
    543546end;
    544547
     
    549552  WriteInteger(Node, 'DiscoveredCells', DiscoveredCells);
    550553  WriteInteger(Node, 'Cities', Cities);
     554  WriteInteger(Node, 'WinObjectiveCells', WinObjectiveCells);
    551555end;
    552556
     
    15561560  with Cell do begin
    15571561    if Assigned(Player) then begin
    1558       Player.TotalCells := Player.TotalCells + 1;
    1559       Player.TotalUnits := Player.TotalUnits + Power;
     1562      Inc(Player.TotalCells);
     1563      Inc(Player.TotalUnits, Power);
    15601564      if Terrain = ttCity then
    1561         Player.TotalCities := Player.TotalCities + 1;
     1565        Inc(Player.TotalCities);
     1566      if Extra = etObjectiveTarget then
     1567        Inc(Player.TotalWinObjectiveCells);
    15621568    end;
    15631569  end;
     
    25052511  TotalCities := 0;
    25062512  TotalDiscovered := 0;
     2513  TotalWinObjectiveCells := 0;
    25072514  TurnStats.Clear;
    25082515  StartCell := nil;
     
    31183125    TotalCells := 0;
    31193126    TotalCities := 0;
    3120 
     3127    TotalWinObjectiveCells := 0;
    31213128    TotalDiscovered := 0;
    31223129    for J := 0 to PlayerMap.Cells.Count - 1 do
     
    31413148    NewStat.Units := TotalUnits;
    31423149    NewStat.Cities := TotalCities;
     3150    NewStat.WinObjectiveCells := TotalWinObjectiveCells;
    31433151    TurnStats.Add(NewStat);
    31443152  end;
Note: See TracChangeset for help on using the changeset viewer.