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

◆ CompareTo()

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

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

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

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

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