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

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormPlayersStats.pas

    r317 r318  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    7   Menus, ActnList, Game, ListViewSort, FormEx;
     7  Menus, ActnList, Game, ListViewSort, FormEx, Player;
    88
    99type
     
    2323    function ListViewSort1CompareItem(Item1, Item2: TObject): Integer;
    2424    procedure ListViewSort1Filter(ListViewSort: TListViewSort);
     25  private
     26    FOnSpectate: TPlayerEvent;
    2527  public
     28    Game: TGame;
    2629    procedure ReloadList;
     30    property OnSpectate: TPlayerEvent read FOnSpectate write FOnSpectate;
    2731  end;
    2832
    2933
    3034implementation
    31 
    32 uses
    33   Core, Player;
    3435
    3536{$R *.lfm}
     
    3940procedure TFormPlayersStats.ListView1Data(Sender: TObject; Item: TListItem);
    4041begin
    41   with Core.Core.Game do
     42  with Game do
    4243  if Item.Index < ListViewSort1.List.Count then
    4344  with TPlayer(ListViewSort1.List[Item.Index]) do begin
     
    7778begin
    7879  ListViewSort1.List.Clear;
    79   for I := 0 to Core.Core.Game.Players.Count - 1 do begin
    80     ListViewSort1.List.Add(Core.Core.Game.Players[I]);
     80  for I := 0 to Game.Players.Count - 1 do begin
     81    ListViewSort1.List.Add(Game.Players[I]);
    8182  end;
    8283end;
     
    9091begin
    9192  if Assigned(ListView1.Selected) then
    92     Core.Core.Spectate(TPlayer(ListView1.Selected.Data));
     93    if Assigned(FOnSpectate) then
     94      FOnSpectate(TPlayer(ListView1.Selected.Data));
    9395end;
    9496
Note: See TracChangeset for help on using the changeset viewer.