{"action":"created","comment":{"url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/comments/25547652","id":25547652,"diff_hunk":"@@ -0,0 +1,100 @@\n+//\n+//  MonsterEncyclopediaViewController.m\n+//  MH4U Dex\n+//\n+//  Created by Joseph Goldberg on 2/6/15.\n+//  Copyright (c) 2015 Joseph Goldberg. All rights reserved.\n+//\n+\n+#import \"MonsterEncyclopediaViewController.h\"\n+\n+#import <CoreData/CoreData.h>\n+\n+#import \"MonsterEncyclopediaCell.h\"\n+#import \"Monster.h\"\n+#import \"MonsterOverviewViewController.h\"\n+#import \"MonsterDetailsViewController.h\"\n+\n+@interface MonsterEncyclopediaViewController ()\n+\n+@property (nonatomic, strong) NSArray *smallMonsters;\n+@property (nonatomic, strong) NSArray *largeMonsters;\n+\n+@end\n+\n+@implementation MonsterEncyclopediaViewController\n+\n+- (void)viewDidLoad\n+{\n+    [super viewDidLoad];\n+\n+    NSError *fetchError = nil;\n+    NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@\"Monster\"];\n+    NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@\"sort_name\" ascending:YES];\n+    NSPredicate *predicate = [NSPredicate predicateWithFormat:@\"%K == %@\", @\"monster_class\", @\"Minion\"];\n+    [fetchRequest setPredicate:predicate];\n+    [fetchRequest setSortDescriptors:@[sortDescriptor]];\n+    self.smallMonsters = [self.managedObjectContext executeFetchRequest:fetchRequest error:&fetchError];\n+    if (fetchError) {\n+        NSLog(@\"Error fetching small monster data.\");\n+        NSLog(@\"%@, %@\", fetchError, fetchError.localizedDescription);\n+    }\n+    predicate = [NSPredicate predicateWithFormat:@\"%K == %@\", @\"monster_class\", @\"Boss\"];\n+    [fetchRequest setPredicate:predicate];\n+    self.largeMonsters = [self.managedObjectContext executeFetchRequest:fetchRequest error:&fetchError];\n+    if (fetchError) {\n+        NSLog(@\"Error fetching large monster data.\");\n+        NSLog(@\"%@, %@\", fetchError, fetchError.localizedDescription);\n+    }\n+}\n+\n+#pragma mark - Navigation\n+\n+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender\n+{\n+    if ([segue.identifier isEqualToString:@\"showMonsterDetails\"]) {\n+        MonsterDetailsViewController *detailVC = (MonsterDetailsViewController *)segue.destinationViewController;\n+        detailVC.managedObjectContext = self.managedObjectContext;\n+        detailVC.monster = [sender monsterName];\n+    }\n+    \n+}\n+\n+#pragma mark <UICollectionViewDataSource>\n+\n+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView\n+{\n+    return 2;\n+}\n+\n+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section\n+{\n+    switch (section) {\n+        case 0:\n+            return self.smallMonsters.count;\n+        case 1:\n+            return self.largeMonsters.count;\n+        default:\n+            return 0;\n+    }\n+}\n+\n+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath\n+{\n+    MonsterEncyclopediaCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MonsterEncyclopediaCell class])\n+                                                                              forIndexPath:indexPath];\n+    Monster *monster;\n+    switch (indexPath.section) {\n+        case 0:\n+        monster = (Monster *)self.smallMonsters[indexPath.row];\n+        break;\n+        case 1:\n+        monster = (Monster *)self.largeMonsters[indexPath.row];\n+        break;\n+    }","path":"MH4U Dex/MonsterEncyclopediaViewController.m","position":94,"original_position":94,"commit_id":"5aeea0e9325419a4f6edec7b6a57adef9b7fddcd","original_commit_id":"5aeea0e9325419a4f6edec7b6a57adef9b7fddcd","user":{"login":"vokal-isaac","id":7505072,"avatar_url":"https://avatars.githubusercontent.com/u/7505072?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal-isaac","html_url":"https://github.com/vokal-isaac","followers_url":"https://api.github.com/users/vokal-isaac/followers","following_url":"https://api.github.com/users/vokal-isaac/following{/other_user}","gists_url":"https://api.github.com/users/vokal-isaac/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal-isaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal-isaac/subscriptions","organizations_url":"https://api.github.com/users/vokal-isaac/orgs","repos_url":"https://api.github.com/users/vokal-isaac/repos","events_url":"https://api.github.com/users/vokal-isaac/events{/privacy}","received_events_url":"https://api.github.com/users/vokal-isaac/received_events","type":"User","site_admin":false},"body":"Indentation within this `switch` doesn't look right.","created_at":"2015-02-27T23:28:57Z","updated_at":"2015-02-27T23:28:57Z","html_url":"https://github.com/vokal/MH4U-Dex/pull/1#discussion_r25547652","pull_request_url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/comments/25547652"},"html":{"href":"https://github.com/vokal/MH4U-Dex/pull/1#discussion_r25547652"},"pull_request":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1","id":30106272,"html_url":"https://github.com/vokal/MH4U-Dex/pull/1","diff_url":"https://github.com/vokal/MH4U-Dex/pull/1.diff","patch_url":"https://github.com/vokal/MH4U-Dex/pull/1.patch","issue_url":"https://api.github.com/repos/vokal/MH4U-Dex/issues/1","number":1,"state":"open","locked":false,"title":"Initial (Huge) commit","user":{"login":"jmgoldb","id":10276487,"avatar_url":"https://avatars.githubusercontent.com/u/10276487?v=3","gravatar_id":"","url":"https://api.github.com/users/jmgoldb","html_url":"https://github.com/jmgoldb","followers_url":"https://api.github.com/users/jmgoldb/followers","following_url":"https://api.github.com/users/jmgoldb/following{/other_user}","gists_url":"https://api.github.com/users/jmgoldb/gists{/gist_id}","starred_url":"https://api.github.com/users/jmgoldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmgoldb/subscriptions","organizations_url":"https://api.github.com/users/jmgoldb/orgs","repos_url":"https://api.github.com/users/jmgoldb/repos","events_url":"https://api.github.com/users/jmgoldb/events{/privacy}","received_events_url":"https://api.github.com/users/jmgoldb/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-26T19:08:48Z","updated_at":"2015-02-27T23:28:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da381442d3bce6bd0a4b5b5d6051c0b8a2adc29d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1/commits","review_comments_url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1/comments","review_comment_url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vokal/MH4U-Dex/issues/1/comments","statuses_url":"https://api.github.com/repos/vokal/MH4U-Dex/statuses/5aeea0e9325419a4f6edec7b6a57adef9b7fddcd","head":{"label":"jmgoldb:master","ref":"master","sha":"5aeea0e9325419a4f6edec7b6a57adef9b7fddcd","user":{"login":"jmgoldb","id":10276487,"avatar_url":"https://avatars.githubusercontent.com/u/10276487?v=3","gravatar_id":"","url":"https://api.github.com/users/jmgoldb","html_url":"https://github.com/jmgoldb","followers_url":"https://api.github.com/users/jmgoldb/followers","following_url":"https://api.github.com/users/jmgoldb/following{/other_user}","gists_url":"https://api.github.com/users/jmgoldb/gists{/gist_id}","starred_url":"https://api.github.com/users/jmgoldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmgoldb/subscriptions","organizations_url":"https://api.github.com/users/jmgoldb/orgs","repos_url":"https://api.github.com/users/jmgoldb/repos","events_url":"https://api.github.com/users/jmgoldb/events{/privacy}","received_events_url":"https://api.github.com/users/jmgoldb/received_events","type":"User","site_admin":false},"repo":{"id":30926106,"name":"MH4U-Dex","full_name":"jmgoldb/MH4U-Dex","owner":{"login":"jmgoldb","id":10276487,"avatar_url":"https://avatars.githubusercontent.com/u/10276487?v=3","gravatar_id":"","url":"https://api.github.com/users/jmgoldb","html_url":"https://github.com/jmgoldb","followers_url":"https://api.github.com/users/jmgoldb/followers","following_url":"https://api.github.com/users/jmgoldb/following{/other_user}","gists_url":"https://api.github.com/users/jmgoldb/gists{/gist_id}","starred_url":"https://api.github.com/users/jmgoldb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmgoldb/subscriptions","organizations_url":"https://api.github.com/users/jmgoldb/orgs","repos_url":"https://api.github.com/users/jmgoldb/repos","events_url":"https://api.github.com/users/jmgoldb/events{/privacy}","received_events_url":"https://api.github.com/users/jmgoldb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmgoldb/MH4U-Dex","description":"Joseph Goldberg's apprentice project. ","fork":true,"url":"https://api.github.com/repos/jmgoldb/MH4U-Dex","forks_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/forks","keys_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/teams","hooks_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/hooks","issue_events_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/issues/events{/number}","events_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/events","assignees_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/assignees{/user}","branches_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/branches{/branch}","tags_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/tags","blobs_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/statuses/{sha}","languages_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/languages","stargazers_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/stargazers","contributors_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/contributors","subscribers_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/subscribers","subscription_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/subscription","commits_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/contents/{+path}","compare_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/merges","archive_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/downloads","issues_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/issues{/number}","pulls_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/pulls{/number}","milestones_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/milestones{/number}","notifications_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/labels{/name}","releases_url":"https://api.github.com/repos/jmgoldb/MH4U-Dex/releases{/id}","created_at":"2015-02-17T16:36:09Z","updated_at":"2015-02-26T19:07:21Z","pushed_at":"2015-02-26T19:07:19Z","git_url":"git://github.com/jmgoldb/MH4U-Dex.git","ssh_url":"git@github.com:jmgoldb/MH4U-Dex.git","clone_url":"https://github.com/jmgoldb/MH4U-Dex.git","svn_url":"https://github.com/jmgoldb/MH4U-Dex","homepage":null,"size":217,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vokal:master","ref":"master","sha":"8cb757b1c31a4c46725b509cc1c02ee60809c4cb","user":{"login":"vokal","id":375026,"avatar_url":"https://avatars.githubusercontent.com/u/375026?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal","html_url":"https://github.com/vokal","followers_url":"https://api.github.com/users/vokal/followers","following_url":"https://api.github.com/users/vokal/following{/other_user}","gists_url":"https://api.github.com/users/vokal/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal/subscriptions","organizations_url":"https://api.github.com/users/vokal/orgs","repos_url":"https://api.github.com/users/vokal/repos","events_url":"https://api.github.com/users/vokal/events{/privacy}","received_events_url":"https://api.github.com/users/vokal/received_events","type":"Organization","site_admin":false},"repo":{"id":30926028,"name":"MH4U-Dex","full_name":"vokal/MH4U-Dex","owner":{"login":"vokal","id":375026,"avatar_url":"https://avatars.githubusercontent.com/u/375026?v=3","gravatar_id":"","url":"https://api.github.com/users/vokal","html_url":"https://github.com/vokal","followers_url":"https://api.github.com/users/vokal/followers","following_url":"https://api.github.com/users/vokal/following{/other_user}","gists_url":"https://api.github.com/users/vokal/gists{/gist_id}","starred_url":"https://api.github.com/users/vokal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokal/subscriptions","organizations_url":"https://api.github.com/users/vokal/orgs","repos_url":"https://api.github.com/users/vokal/repos","events_url":"https://api.github.com/users/vokal/events{/privacy}","received_events_url":"https://api.github.com/users/vokal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vokal/MH4U-Dex","description":"Joseph Goldberg's apprentice project. ","fork":false,"url":"https://api.github.com/repos/vokal/MH4U-Dex","forks_url":"https://api.github.com/repos/vokal/MH4U-Dex/forks","keys_url":"https://api.github.com/repos/vokal/MH4U-Dex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vokal/MH4U-Dex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vokal/MH4U-Dex/teams","hooks_url":"https://api.github.com/repos/vokal/MH4U-Dex/hooks","issue_events_url":"https://api.github.com/repos/vokal/MH4U-Dex/issues/events{/number}","events_url":"https://api.github.com/repos/vokal/MH4U-Dex/events","assignees_url":"https://api.github.com/repos/vokal/MH4U-Dex/assignees{/user}","branches_url":"https://api.github.com/repos/vokal/MH4U-Dex/branches{/branch}","tags_url":"https://api.github.com/repos/vokal/MH4U-Dex/tags","blobs_url":"https://api.github.com/repos/vokal/MH4U-Dex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vokal/MH4U-Dex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vokal/MH4U-Dex/git/refs{/sha}","trees_url":"https://api.github.com/repos/vokal/MH4U-Dex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vokal/MH4U-Dex/statuses/{sha}","languages_url":"https://api.github.com/repos/vokal/MH4U-Dex/languages","stargazers_url":"https://api.github.com/repos/vokal/MH4U-Dex/stargazers","contributors_url":"https://api.github.com/repos/vokal/MH4U-Dex/contributors","subscribers_url":"https://api.github.com/repos/vokal/MH4U-Dex/subscribers","subscription_url":"https://api.github.com/repos/vokal/MH4U-Dex/subscription","commits_url":"https://api.github.com/repos/vokal/MH4U-Dex/commits{/sha}","git_commits_url":"https://api.github.com/repos/vokal/MH4U-Dex/git/commits{/sha}","comments_url":"https://api.github.com/repos/vokal/MH4U-Dex/comments{/number}","issue_comment_url":"https://api.github.com/repos/vokal/MH4U-Dex/issues/comments{/number}","contents_url":"https://api.github.com/repos/vokal/MH4U-Dex/contents/{+path}","compare_url":"https://api.github.com/repos/vokal/MH4U-Dex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vokal/MH4U-Dex/merges","archive_url":"https://api.github.com/repos/vokal/MH4U-Dex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vokal/MH4U-Dex/downloads","issues_url":"https://api.github.com/repos/vokal/MH4U-Dex/issues{/number}","pulls_url":"https://api.github.com/repos/vokal/MH4U-Dex/pulls{/number}","milestones_url":"https://api.github.com/repos/vokal/MH4U-Dex/milestones{/number}","notifications_url":"https://api.github.com/repos/vokal/MH4U-Dex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vokal/MH4U-Dex/labels{/name}","releases_url":"https://api.github.com/repos/vokal/MH4U-Dex/releases{/id}","created_at":"2015-02-17T16:34:05Z","updated_at":"2015-02-17T16:34:05Z","pushed_at":"2015-02-17T16:34:05Z","git_url":"git://github.com/vokal/MH4U-Dex.git","ssh_url":"git@github.com:vokal/MH4U-Dex.git","clone_url":"https://github.com/vokal/MH4U-Dex.git","svn_url":"https://github.com/vokal/MH4U-Dex","homepage":null,"size":269,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1"},"html":{"href":"https://github.com/vokal/MH4U-Dex/pull/1"},"issue":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/issues/1"},"comments":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/vokal/MH4U-Dex/statuses/5aeea0e9325419a4f6edec7b6a57adef9b7fddcd"}}}}