diff --git a/MonsterCards/Base.lproj/Main.storyboard b/MonsterCards/Base.lproj/Main.storyboard index e23a09a..84fe5db 100644 --- a/MonsterCards/Base.lproj/Main.storyboard +++ b/MonsterCards/Base.lproj/Main.storyboard @@ -202,17 +202,17 @@ - + - - + + - - + + @@ -223,25 +223,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -253,9 +381,15 @@ + + + + + + diff --git a/MonsterCards/Models/Monster.m b/MonsterCards/Models/Monster.m index 64d47e7..22e0d5d 100644 --- a/MonsterCards/Models/Monster.m +++ b/MonsterCards/Models/Monster.m @@ -303,27 +303,28 @@ NSString* const kMonsterSizeGargantuan = @"gargantuan"; } -(NSString*)strengthDescription { - @throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil]; + return [NSString stringWithFormat:@"%d (%+d)", self.strengthScore, self.strengthModifier]; } -(NSString*)dexterityDescription { - @throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil]; + return [NSString stringWithFormat:@"%d (%+d)", self.dexterityScore, self.dexterityModifier]; } -(NSString*)constitutionDescription { - @throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil]; + return [NSString stringWithFormat:@"%d (%+d)", self.constitutionScore, self.constitutionModifier]; } -(NSString*)intelligenceDescription { - @throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil]; + return [NSString stringWithFormat:@"%d (%+d)", self.intelligenceScore, self.intelligenceModifier]; + } -(NSString*)wisdomDescription { - @throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil]; + return [NSString stringWithFormat:@"%d (%+d)", self.wisdomScore, self.wisdomModifier]; } -(NSString*)charismaDescription { - @throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil]; + return [NSString stringWithFormat:@"%d (%+d)", self.charismaScore, self.charismaModifier]; } -(NSSet*)savingThrows { diff --git a/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents b/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents index f7d4b9f..9555877 100644 --- a/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents +++ b/MonsterCards/MonsterCards.xcdatamodeld/MonsterCards.xcdatamodel/contents @@ -6,29 +6,29 @@ - + - + - + - + - + - + diff --git a/MonsterCards/Views/MonsterViewController.h b/MonsterCards/Views/MonsterViewController.h index c04657d..981bfc8 100644 --- a/MonsterCards/Views/MonsterViewController.h +++ b/MonsterCards/Views/MonsterViewController.h @@ -18,6 +18,12 @@ NS_ASSUME_NONNULL_BEGIN @property (weak, nonatomic) IBOutlet UILabel *monsterArmorClass; @property (weak, nonatomic) IBOutlet UILabel *monsterHitPoints; @property (weak, nonatomic) IBOutlet UILabel *monsterSpeed; +@property (weak, nonatomic) IBOutlet UILabel *monsterStrength; +@property (weak, nonatomic) IBOutlet UILabel *monsterDexterity; +@property (weak, nonatomic) IBOutlet UILabel *monsterConstitution; +@property (weak, nonatomic) IBOutlet UILabel *monsterIntelligence; +@property (weak, nonatomic) IBOutlet UILabel *monsterWisdom; +@property (weak, nonatomic) IBOutlet UILabel *monsterCharisma; @property Monster* monster; diff --git a/MonsterCards/Views/MonsterViewController.m b/MonsterCards/Views/MonsterViewController.m index f9a5ebc..89fa55d 100644 --- a/MonsterCards/Views/MonsterViewController.m +++ b/MonsterCards/Views/MonsterViewController.m @@ -87,6 +87,24 @@ NSString* makeHTMLFragmentString(NSString* format, ...) { self.monsterSpeed.attributedText = [HTMLHelper attributedStringFromHTML:makeHTMLFragmentString(@"Speed %@", speedDescription)]; } } + if (self.monsterStrength) { + self.monsterStrength.text = self.monster.strengthDescription; + } + if (self.monsterDexterity) { + self.monsterDexterity.text = self.monster.dexterityDescription; + } + if (self.monsterConstitution) { + self.monsterConstitution.text = self.monster.constitutionDescription; + } + if (self.monsterIntelligence) { + self.monsterIntelligence.text = self.monster.intelligenceDescription; + } + if (self.monsterWisdom) { + self.monsterWisdom.text = self.monster.wisdomDescription; + } + if (self.monsterCharisma) { + self.monsterCharisma.text = self.monster.charismaDescription; + } } - (IBAction)unwindWithSegue:(UIStoryboardSegue *)unwindSegue {