summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLTurn.m
blob: 53d462c92df087cbee5a4ee93318f460d2a0ab38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//  SDLTurn.m
//

#import "SDLTurn.h"

#import "SDLImage.h"
#import "SDLNames.h"

@implementation SDLTurn

- (instancetype)init {
    if (self = [super init]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary<NSString *, id> *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setNavigationText:(NSString *)navigationText {
    if (navigationText != nil) {
        [store setObject:navigationText forKey:SDLNameNavigationText];
    } else {
        [store removeObjectForKey:SDLNameNavigationText];
    }
}

- (NSString *)navigationText {
    return [store objectForKey:SDLNameNavigationText];
}

- (void)setTurnIcon:(SDLImage *)turnIcon {
    if (turnIcon != nil) {
        [store setObject:turnIcon forKey:SDLNameTurnIcon];
    } else {
        [store removeObjectForKey:SDLNameTurnIcon];
    }
}

- (SDLImage *)turnIcon {
    NSObject *obj = [store objectForKey:SDLNameTurnIcon];
    if (obj == nil || [obj isKindOfClass:SDLImage.class]) {
        return (SDLImage *)obj;
    } else {
        return [[SDLImage alloc] initWithDictionary:(NSMutableDictionary *)obj];
    }
}

@end