Skip to content

Commit

Permalink
Define which games need special handling
Browse files Browse the repository at this point in the history
  • Loading branch information
koraktor committed Apr 28, 2015
1 parent 6ad8783 commit b31679f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Suitcase/Classes/SCGamesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,20 @@ @implementation SCGamesViewController
NSString *const kSCSchemaIsLoading = @"kSCSchemaIsLoading";
NSString *const kSCSchemaIsLoadingDetail = @"kSCSchemaIsLoadingDetail";

static NSArray *kSCNonDiscoverableInventories;
static NSArray *kSCNonWebApiInventories;

typedef NS_ENUM(NSUInteger, SCInventorySection) {
SCInventorySectionNoInventories,
SCInventorySectionSteam,
SCInventorySectionGames
};

+ (void)initialize {
kSCNonDiscoverableInventories = @[@753, @104700, @230410, @251970];
kSCNonWebApiInventories = [kSCNonDiscoverableInventories arrayByAddingObjectsFromArray:@[@620, @730, @238460]];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch (alertView.tag) {
Expand Down Expand Up @@ -155,7 +163,7 @@ - (void)loadAvailableGames
[apiListOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary *apiListResponse = [responseObject objectForKey:@"apilist"];
NSArray *interfaces = [apiListResponse objectForKey:@"interfaces"];
NSMutableSet *availableGames = [NSMutableSet setWithObjects:@753, @104700, @230410, @251970, nil];
NSMutableSet *availableGames = [NSMutableSet setWithArray:kSCNonDiscoverableInventories];
[interfaces enumerateObjectsUsingBlock:^(NSDictionary *interface, NSUInteger idx, BOOL *stop) {
NSString *interfaceName = [interface valueForKey:@"name"];
if ([interfaceName hasPrefix:@"IEconItems_"]) {
Expand Down Expand Up @@ -395,7 +403,7 @@ - (void)populateGames:(NSArray *)games
for (SCGame *game in _games) {
Class inventoryClass;

if ([@[@620, @730, @753, @104700, @230410, @238460, @251970] containsObject:game.appId]) {
if ([kSCNonWebApiInventories containsObject:game.appId]) {
inventoryClass = [SCCommunityInventory class];
} else {
inventoryClass = [SCWebApiInventory class];
Expand Down

0 comments on commit b31679f

Please sign in to comment.