Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOCommodityMarket.m File Reference
+ Include dependency graph for OOCommodityMarket.m:

Go to the source code of this file.

Functions

static NSComparisonResult goodsSorter (id a, id b, void *context)
 

Function Documentation

◆ goodsSorter()

static NSComparisonResult goodsSorter ( id a,
id b,
void * context )
static

Definition at line 408 of file OOCommodityMarket.m.

409{
410 NSDictionary *commodityList = (NSDictionary *)context;
411 int v1 = [[commodityList oo_dictionaryForKey:(NSString *)a] oo_intForKey:kOOCommoditySortOrder];
412 int v2 = [[commodityList oo_dictionaryForKey:(NSString *)b] oo_intForKey:kOOCommoditySortOrder];
413
414 if (v1 < v2)
415 {
416 return NSOrderedAscending;
417 }
418 else if (v1 > v2)
419 {
420 return NSOrderedDescending;
421 }
422 else
423 {
424 return NSOrderedSame;
425 }
426}