Changeset 199 for trunk/UServerList.pas
- Timestamp:
- May 16, 2018, 2:48:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UServerList.pas
r196 r199 21 21 MapName: string; 22 22 Latency: TTime; 23 procedure Assign(Source: TServerInfo); 23 24 constructor Create; 24 25 end; … … 33 34 Address: string; 34 35 Items: TServerInfos; 36 procedure Assign(Source: TServerList); 35 37 constructor Create; 36 38 destructor Destroy; override; … … 47 49 { TServerInfo } 48 50 51 procedure TServerInfo.Assign(Source: TServerInfo); 52 begin 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; 61 end; 62 49 63 constructor TServerInfo.Create; 50 64 begin … … 53 67 54 68 { TServerList } 69 70 procedure TServerList.Assign(Source: TServerList); 71 var 72 I: Integer; 73 begin 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; 81 end; 55 82 56 83 constructor TServerList.Create;
Note:
See TracChangeset
for help on using the changeset viewer.