Adds copy constructor to Monster initWithMonster.
This commit is contained in:
@@ -66,6 +66,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
-(id)initWithJSONString:(NSString*)jsonString;
|
||||
-(id)initWithJSONData:(NSData*)jsonData;
|
||||
-(id)initWithMonster:(Monster*)monster;
|
||||
-(NSString*)meta;
|
||||
-(int)abilityScoreForAbilityScoreName: (NSString*)abilityScoreName;
|
||||
-(int)abilityModifierForAbilityScoreName: (NSString*)abilityScoreName;
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
-(id)initWithMonster:(Monster*)monster {
|
||||
if (monster == nil) {
|
||||
return [self init];
|
||||
}
|
||||
|
||||
self = [super init];
|
||||
|
||||
self.name = monster.name;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSString*)meta {
|
||||
@throw [[NSException alloc] initWithName:@"unimplemented" reason:@"Method not implemented." userInfo:nil];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user