Changeset 199 for trunk/UServerList.pas


Ignore:
Timestamp:
May 16, 2018, 2:48:57 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Initial game setting made independent to current game settings. So last game can be automatically loaded on start and initial setting will be intact.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UServerList.pas

    r196 r199  
    2121    MapName: string;
    2222    Latency: TTime;
     23    procedure Assign(Source: TServerInfo);
    2324    constructor Create;
    2425  end;
     
    3334    Address: string;
    3435    Items: TServerInfos;
     36    procedure Assign(Source: TServerList);
    3537    constructor Create;
    3638    destructor Destroy; override;
     
    4749{ TServerInfo }
    4850
     51procedure TServerInfo.Assign(Source: TServerInfo);
     52begin
     53  Name := Source.Name;
     54  Address := Source.Address;
     55  Port := Source.Port;
     56  PlayersCountCurrent := Source.PlayersCountCurrent;
     57  PlayersCountMax := Source.PlayersCountMax;
     58  Password := Source.Password;
     59  MapName := Source.MapName;
     60  Latency := Source.Latency;
     61end;
     62
    4963constructor TServerInfo.Create;
    5064begin
     
    5367
    5468{ TServerList }
     69
     70procedure TServerList.Assign(Source: TServerList);
     71var
     72  I: Integer;
     73begin
     74  while Items.Count > Source.Items.Count do
     75    Items.Delete(Items.Count - 1);
     76  while Items.Count < Source.Items.Count do
     77    Items.Add(TServerInfo.Create);
     78  for I := 0 to Items.Count - 1 do begin
     79    Items[I].Assign(Source.Items[I]);
     80  end;
     81end;
    5582
    5683constructor TServerList.Create;
Note: See TracChangeset for help on using the changeset viewer.