espagram/Espagram/Lesson+Conjugator.m
2013-02-21 17:08:51 +01:00

43 lines
837 B
Objective-C

//
// Lesson+Conjugator.m
// Espagram
//
// Created by Abel Fokkinga on 11/14/12.
// Copyright (c) 2012 Abel Fokkinga. All rights reserved.
//
#import "Lesson+Conjugator.h"
#import "SpanishConjugator.h"
@implementation Lesson (Conjugator)
- (id <Conjugator>) getConjugationEngine
{
if ( [self.conjugator isEqualToString:@"Spanish"] )
return [[SpanishConjugator alloc] init];
else
return nil;
}
- (Tense *) getTenseAsTense
{
Tense * tense = [[Tense alloc] init];
tense.tense = self.tense;
return tense;
}
- (NSString *) getTenseName
{
Tense * tense = [[Tense alloc] init];
tense.tense = self.tense;
return [tense getTenseInLanguage:self.conjugator];
}
- (NSString *) getLocalizedTense;
{
return NSLocalizedString([@"TENSE_" stringByAppendingString:self.tense], nil);
}
@end