Adds copy constructor to Monster initWithMonster.

This commit is contained in:
2020-09-11 23:30:22 -07:00
parent 15a89785c6
commit 327a640b83
2 changed files with 13 additions and 0 deletions

View File

@@ -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];
}