DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ CompareTo()

int GetServersResultRow::CompareTo ( GetServersResultRow other,
ESortType sortType )
inlineprivate

См. определение в файле BiosLobbyService.c строка 298

299 {
300 // string comparison
301 if (sortType == ESortType.HOST || sortType == ESortType.MAP)
302 {
303 string val1 = this.GetValueStr(sortType);
304 string val2 = other.GetValueStr(sortType);
305
306 if (val1 == val2)
307 return 0;
308
309 if (val1 < val2)
310 return 1;
311
312 return -1;
313 }
314
315 // int comparison
316 int comparisonResult = other.GetValueInt(sortType) - this.GetValueInt(sortType);
317 if (comparisonResult == 0)
318 {
319 // if sorting by POPULATION, break ties using QUEUE size
320 if (sortType == ESortType.POPULATION)
321 {
322 comparisonResult = this.CompareTo(other, ESortType.QUEUE);
323 }
324 }
325
326 return comparisonResult;
327 }
ESortType
Определения BiosLobbyService.c:33
string GetValueStr(ESortType sort_type)
Определения BiosLobbyService.c:247
int CompareTo(GetServersResultRow other, ESortType sortType)
Определения BiosLobbyService.c:298
int GetValueInt(ESortType sort_type)
Определения BiosLobbyService.c:267

Перекрестные ссылки CompareTo(), GetValueInt() и GetValueStr().

Используется в CompareTo() и ServerBrowserTab::SortedInsertEx().