Ignore:
Timestamp:
Jun 21, 2024, 3:20:20 PM (2 weeks ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormCharts.pas

    r317 r318  
    55uses
    66  Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls, Graphics,
    7   Dialogs, StdCtrls, FormEx;
     7  Dialogs, StdCtrls, FormEx, Game;
    88
    99type
     
    1616    procedure ComboBox1Change(Sender: TObject);
    1717    procedure FormShow(Sender: TObject);
     18  private
     19    FGame: TGame;
    1820  public
    1921    procedure Redraw;
    2022    procedure Translate;
     23    property Game: TGame read FGame write FGame;
    2124  end;
    2225
     
    2730
    2831uses
    29   Core, Game, Player;
     32  Player;
    3033
    3134resourcestring
     
    3538  SCitiesCount = 'Cities count';
    3639  SWinObjectiveCells = 'Win objective cells';
    37 
    3840
    3941{ TFormCharts }
     
    5961begin
    6062  Chart1.Series.Clear;
    61   for I := 0 to Core.Core.Game.Players.Count - 1 do
    62   with TPlayer(Core.Core.Game.Players[I]) do begin
     63  for I := 0 to Game.Players.Count - 1 do
     64  with TPlayer(Game.Players[I]) do begin
    6365    NewSeries := TLineSeries.Create(nil);
    6466    NewSeries.LinePen.Color := Color;
    6567    for X := 0 to TurnStats.Count - 1 do begin
    66       if ComboBox1.ItemIndex = 0 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).OccupiedCells)
    67       else if ComboBox1.ItemIndex = 1 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).Units)
    68       else if ComboBox1.ItemIndex = 2 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).DiscoveredCells)
    69       else if ComboBox1.ItemIndex = 3 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).Cities)
    70       else if ComboBox1.ItemIndex = 4 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).WinObjectiveCells);
     68      if ComboBox1.ItemIndex = 0 then NewSeries.AddXY(X, TurnStats[X].OccupiedCells)
     69      else if ComboBox1.ItemIndex = 1 then NewSeries.AddXY(X, TurnStats[X].Units)
     70      else if ComboBox1.ItemIndex = 2 then NewSeries.AddXY(X, TurnStats[X].DiscoveredCells)
     71      else if ComboBox1.ItemIndex = 3 then NewSeries.AddXY(X, TurnStats[X].Cities)
     72      else if ComboBox1.ItemIndex = 4 then NewSeries.AddXY(X, TurnStats[X].WinObjectiveCells);
    7173    end;
    7274    Chart1.AddSeries(NewSeries);
     
    7880  LastIndex: Integer;
    7981begin
    80   Core.Core.Translator1.TranslateComponentRecursive(Self);
     82  TFormEx.Translator.TranslateComponentRecursive(Self);
    8183  with ComboBox1 do begin
    8284    LastIndex := ItemIndex;
Note: See TracChangeset for help on using the changeset viewer.