37 |
/** |
/** |
38 |
* Initialize a new player, with a given name. |
* Initialize a new player, with a given name. |
39 |
*/ |
*/ |
40 |
-(id)initWithPlayer: (HgPlayer *)player |
- (id) initWithPlayer: (HgPlayer *)player |
41 |
{ |
{ |
42 |
NSParameterAssert (player); |
NSParameterAssert (player); |
43 |
|
|
50 |
return self; |
return self; |
51 |
} |
} |
52 |
|
|
53 |
|
- (void) dealloc |
54 |
|
{ |
55 |
|
RELEASE(_player); |
56 |
|
|
57 |
|
[super dealloc]; |
58 |
|
} |
59 |
|
|
60 |
/** |
/** |
61 |
* Return the player. |
* Return the player. |
62 |
*/ |
*/ |
63 |
-(HgPlayer *) player |
- (HgPlayer *) player |
64 |
{ |
{ |
65 |
return _player; |
return _player; |
66 |
} |
} |
69 |
/** |
/** |
70 |
* Return the player acceleration. |
* Return the player acceleration. |
71 |
*/ |
*/ |
72 |
-(float) acceleration |
- (float) acceleration |
73 |
{ |
{ |
74 |
return _acceleration; |
return _acceleration; |
75 |
} |
} |
77 |
/** |
/** |
78 |
* Change the player acceleration. |
* Change the player acceleration. |
79 |
*/ |
*/ |
80 |
-(void) setAcceleration :(float)acceleration |
- (void) setAcceleration :(float)acceleration |
81 |
{ |
{ |
82 |
_acceleration = acceleration; |
_acceleration = acceleration; |
83 |
} |
} |
85 |
/** |
/** |
86 |
* Return the player direction. |
* Return the player direction. |
87 |
*/ |
*/ |
88 |
-(float) direction |
- (float) direction |
89 |
{ |
{ |
90 |
return _direction; |
return _direction; |
91 |
} |
} |
93 |
/** |
/** |
94 |
* Change the player direction. |
* Change the player direction. |
95 |
*/ |
*/ |
96 |
-(void) setDirection : (float)direction |
- (void) setDirection : (float)direction |
97 |
{ |
{ |
98 |
_direction = direction; |
_direction = direction; |
99 |
} |
} |
120 |
/** |
/** |
121 |
* Return the player canonDirection. |
* Return the player canonDirection. |
122 |
*/ |
*/ |
123 |
-(float) canonDirection |
- (float) canonDirection |
124 |
{ |
{ |
125 |
return _canonDirection; |
return _canonDirection; |
126 |
} |
} |
128 |
/** |
/** |
129 |
* Change the player canonDirection. |
* Change the player canonDirection. |
130 |
*/ |
*/ |
131 |
-(void) setCanonDirection: (float)canonDirection |
- (void) setCanonDirection: (float)canonDirection |
132 |
{ |
{ |
133 |
_canonDirection = canonDirection; |
_canonDirection = canonDirection; |
134 |
} |
} |
136 |
/** |
/** |
137 |
* Return the player canonElevation. |
* Return the player canonElevation. |
138 |
*/ |
*/ |
139 |
-(unsigned) canonElevation |
- (unsigned) canonElevation |
140 |
{ |
{ |
141 |
return _canonElevation; |
return _canonElevation; |
142 |
} |
} |
144 |
/** |
/** |
145 |
* Change the player canonElevation. |
* Change the player canonElevation. |
146 |
*/ |
*/ |
147 |
-(void) setCanonElevation: (unsigned)canonElevation |
- (void) setCanonElevation: (unsigned)canonElevation |
148 |
{ |
{ |
149 |
_canonElevation = canonElevation; |
_canonElevation = canonElevation; |
150 |
} |
} |