24 |
//#include <Foundation/NSArray.h> |
//#include <Foundation/NSArray.h> |
25 |
#include <Foundation/NSException.h> |
#include <Foundation/NSException.h> |
26 |
#include <Foundation/NSCoder.h> |
#include <Foundation/NSCoder.h> |
27 |
|
#include <Foundation/NSNotification.h> |
28 |
|
|
29 |
#include "GameEngine/HgMobile.h" |
#include "GameEngine/HgMobile.h" |
30 |
|
|
60 |
_direction = direction; |
_direction = direction; |
61 |
} |
} |
62 |
|
|
63 |
|
[[NSNotificationCenter defaultCenter] |
64 |
|
postNotificationName:@"updateObject" object: [self game]]; |
65 |
|
|
66 |
return self; |
return self; |
67 |
} |
} |
68 |
|
|
95 |
*/ |
*/ |
96 |
- (void) setDirection: (float)direction |
- (void) setDirection: (float)direction |
97 |
{ |
{ |
98 |
_direction = direction; |
[[NSNotificationCenter defaultCenter] |
99 |
|
postNotificationName:@"updateObject" object: [self game]]; |
100 |
|
|
101 |
|
_direction = direction; |
102 |
} |
} |
103 |
|
|
104 |
/* |
/* |
106 |
*/ |
*/ |
107 |
- (void) setAcceleration: (float)acceleration |
- (void) setAcceleration: (float)acceleration |
108 |
{ |
{ |
109 |
|
[[NSNotificationCenter defaultCenter] |
110 |
|
postNotificationName:@"updateObject" object: [self game]]; |
111 |
|
|
112 |
_acceleration = acceleration; |
_acceleration = acceleration; |
113 |
} |
} |
114 |
|
|
131 |
*/ |
*/ |
132 |
- (void) setMaxSpeed: (unsigned)maxSpeed |
- (void) setMaxSpeed: (unsigned)maxSpeed |
133 |
{ |
{ |
134 |
|
[[NSNotificationCenter defaultCenter] |
135 |
|
postNotificationName:@"updateObject" object: [self game]]; |
136 |
|
|
137 |
_maxSpeed = maxSpeed; |
_maxSpeed = maxSpeed; |
138 |
} |
} |
139 |
|
|
142 |
*/ |
*/ |
143 |
- (void) setMaxAcceleration: (unsigned)maxAcceleration |
- (void) setMaxAcceleration: (unsigned)maxAcceleration |
144 |
{ |
{ |
145 |
|
[[NSNotificationCenter defaultCenter] |
146 |
|
postNotificationName:@"updateObject" object: [self game]]; |
147 |
|
|
148 |
_maxAcceleration = maxAcceleration; |
_maxAcceleration = maxAcceleration; |
149 |
} |
} |
150 |
|
|
151 |
|
@end |
152 |
|
|
153 |
|
@implementation HgMobile (NSCoding) |
154 |
|
|
155 |
/** |
/** |
156 |
* NSCoding method |
* NSCoding method |
157 |
* to encode and decode objects |
* to encode and decode objects |