blob: e73c796036ef2fcca0d7921523887f6fbab5d9af (
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
53
54
55
56
57
58
59
60
61
62
63
|
// SDLOnTouchEvent.m
//
#import "SDLOnTouchEvent.h"
#import "SDLNames.h"
#import "SDLTouchEvent.h"
#import "SDLTouchType.h"
@implementation SDLOnTouchEvent
- (instancetype)init {
if (self = [super initWithName:NAMES_OnTouchEvent]) {
}
return self;
}
- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
if (self = [super initWithDictionary:dict]) {
}
return self;
}
- (void)setType:(SDLTouchType *)type {
if (type != nil) {
[parameters setObject:type forKey:NAMES_type];
} else {
[parameters removeObjectForKey:NAMES_type];
}
}
- (SDLTouchType *)type {
NSObject *obj = [parameters objectForKey:NAMES_type];
if (obj == nil || [obj isKindOfClass:SDLTouchType.class]) {
return (SDLTouchType *)obj;
} else {
return [SDLTouchType valueOf:(NSString *)obj];
}
}
- (void)setEvent:(NSMutableArray *)event {
if (event != nil) {
[parameters setObject:event forKey:NAMES_event];
} else {
[parameters removeObjectForKey:NAMES_event];
}
}
- (NSMutableArray *)event {
NSMutableArray *array = [parameters objectForKey:NAMES_event];
if ([array count] < 1 || [[array objectAtIndex:0] isKindOfClass:SDLTouchEvent.class]) {
return array;
} else {
NSMutableArray *newList = [NSMutableArray arrayWithCapacity:[array count]];
for (NSDictionary *dict in array) {
[newList addObject:[[SDLTouchEvent alloc] initWithDictionary:(NSMutableDictionary *)dict]];
}
return newList;
}
}
@end
|