Skip to content

Commit

Permalink
adding challenge cup
Browse files Browse the repository at this point in the history
  • Loading branch information
akeaswaran committed Jun 29, 2020
1 parent 1e07fe7 commit 6c9ecf9
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 34 deletions.
38 changes: 9 additions & 29 deletions Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<key>mls-bar.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>7</integer>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
2 changes: 2 additions & 0 deletions mls-bar/Core/MatchAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ @implementation MatchAPI
@(MatchLeagueUSL) : @"usa.usl.1",
@(MatchLeagueNWSL) : @"usa.nwsl",
@(MatchLeagueUSOC) : @"usa.open",
@(MatchLeagueNWSLChallengeCup) : @"usa.nwsl.cup"
};
});
return leagues;
Expand All @@ -39,6 +40,7 @@ @implementation MatchAPI
@(MatchLeagueMLS) : @"MLS",
@(MatchLeagueUSL) : @"USLC",
@(MatchLeagueNWSL) : @"NWSL",
@(MatchLeagueNWSLChallengeCup) : @"NWSL",
@(MatchLeagueUSOC) : @"USOC",
};
});
Expand Down
4 changes: 3 additions & 1 deletion mls-bar/Mantle/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ typedef enum : NSUInteger {
GameStateSecondHalf,
GameStateExtraTime,
GameStatePKs,
GameStateCancelled
GameStateCancelled,
GameStatePostponed
} GameState;


Expand All @@ -29,6 +30,7 @@ typedef NS_ENUM(NSInteger, MatchLeague) {
MatchLeagueCCL,
MatchLeagueUSOC,
MatchLeagueNWSL,
MatchLeagueNWSLChallengeCup,
MatchLeagueUnknown
};

Expand Down
6 changes: 5 additions & 1 deletion mls-bar/Mantle/Game.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ + (NSValueTransformer *)statusJSONTransformer {
return @(GameStateInProgress);
} else if ([value isEqualToString:@"STATUS_CANCELLED"]) {
return @(GameStateCancelled);
} else if ([value isEqualToString:@"STATUS_POSTPONED"]) {
return @(GameStatePostponed);
} else if ([value isEqualToString:@"STATUS_FIRST_HALF"]) {
return @(GameStateFirstHalf);
} else if ([value isEqualToString:@"STATUS_SECOND_HALF"]) {
Expand All @@ -70,7 +72,7 @@ + (NSValueTransformer *)statusJSONTransformer {
return @(GameStateHalfTime);
} else if ([value isEqualToString:@"STATUS_PENALTIES"]) {
return @(GameStatePKs);
} else {
} else {
return @(GameStateFinal);
}
}
Expand All @@ -84,6 +86,8 @@ + (NSValueTransformer *)statusDescriptionJSONTransformer {
NSString *period = statusDict[@"type"][@"shortDetail"];
if ([type isEqualToString:@"STATUS_FULL_TIME"] || [type isEqualToString:@"STATUS_SCHEDULED"]) {
return period;
} else if ([type isEqualToString:@"STATUS_POSTPONED"]) {
return @"PPD";
} else {
return clock;
}
Expand Down
4 changes: 2 additions & 2 deletions mls-bar/View Controllers/ScoresViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ -(void)loadGamesForDate:(NSDate *)date {
NSString *dateString = [date formattedDateWithFormat:@"YYYYMMdd"];
[self.currentDateButton setTitle:[date formattedDateWithFormat:@"MMM d, YYYY"]];

NSArray<NSNumber *> *queryLeagues = @[@(MatchLeagueMLS), @(MatchLeagueCCL),@(MatchLeagueNWSL), @(MatchLeagueUSL)]; // USL?
NSArray<NSNumber *> *queryLeagues = @[@(MatchLeagueMLS), @(MatchLeagueCCL),@(MatchLeagueNWSL), @(MatchLeagueUSL), @(MatchLeagueNWSLChallengeCup)];
for (NSNumber *league in queryLeagues) {
[self _loadLeague:[league integerValue] forDate:dateString];
}
Expand Down Expand Up @@ -281,7 +281,7 @@ - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn
[cellView.competitionField setTextColor:[NSColor labelColor]];
[cellView.statusField sizeToFit];

if (item.status == GameStateScheduled) {
if (item.status == GameStateScheduled || item.status == GameStatePostponed) {
[cellView.homeScoreLabel setAlphaValue:0.0];
[cellView.awayScoreLabel setAlphaValue:0.0];
} else {
Expand Down

0 comments on commit 6c9ecf9

Please sign in to comment.