43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
controllers = [[OFArray alloc] initWithObject:
[[[OFGameController alloc] of_init] autorelease]];
objc_autoreleasePoolPop(pool);
}
@implementation OFGameController
+ (OFArray OF_GENERIC(OFGameController *) *)controllers
{
static OFOnceControl onceControl = OFOnceControlInitValue;
OFOnce(&onceControl, initControllers);
return [[controllers retain] autorelease];
|
>
>
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
controllers = [[OFArray alloc] initWithObject:
[[[OFGameController alloc] of_init] autorelease]];
objc_autoreleasePoolPop(pool);
}
@implementation OFGameController
@dynamic leftAnalogStickPosition, rightAnalogStickPosition;
+ (OFArray OF_GENERIC(OFGameController *) *)controllers
{
static OFOnceControl onceControl = OFOnceControlInitValue;
OFOnce(&onceControl, initControllers);
return [[controllers retain] autorelease];
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
[pressedButtons addObject: @"Y"];
[pressedButtons makeImmutable];
return pressedButtons;
}
- (size_t)numAnalogSticks
{
return 0;
}
- (OFPoint)positionOfAnalogStickWithIndex: (size_t)index
{
@throw [OFOutOfRangeException exception];
}
- (OFString *)description
{
return [OFString stringWithFormat: @"<%@: %@>", self.class, self.name];
}
@end
|
|
|
|
|
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
[pressedButtons addObject: @"Y"];
[pressedButtons makeImmutable];
return pressedButtons;
}
- (bool)hasLeftAnalogStick
{
return false;
}
- (bool)hasRightAnalogStick
{
return false;
}
- (OFString *)description
{
return [OFString stringWithFormat: @"<%@: %@>", self.class, self.name];
}
@end
|