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

◆ CompareTo()

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

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

273 {
274 // string comparison
275 if (sortType == ESortType.HOST || sortType == ESortType.MAP)
276 {
277 string val1 = this.GetValueStr(sortType);
278 string val2 = other.GetValueStr(sortType);
279
280 if (val1 == val2)
281 return 0;
282
283 if (val1 < val2)
284 return 1;
285
286 return -1;
287 }
288
289 // int comparison
290 int comparisonResult = other.GetValueInt(sortType) - this.GetValueInt(sortType);
291 if (comparisonResult == 0)
292 {
293 // if sorting by POPULATION, break ties using QUEUE size
294 if (sortType == ESortType.POPULATION)
295 {
296 comparisonResult = this.CompareTo(other, ESortType.QUEUE);
297 }
298 }
299
300 return comparisonResult;
301 }
ESortType
Определения BiosLobbyService.c:7
string GetValueStr(ESortType sort_type)
Определения BiosLobbyService.c:221
int CompareTo(GetServersResultRow other, ESortType sortType)
Определения BiosLobbyService.c:272
int GetValueInt(ESortType sort_type)
Определения BiosLobbyService.c:241

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

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