/[hegemonie]/hegemonie/GameEngine/HgPlayerState.m
ViewVC logotype

Diff of /hegemonie/GameEngine/HgPlayerState.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by thunder, Wed Aug 13 16:44:04 2003 UTC revision 1.13 by nicov, Mon Aug 18 10:37:17 2003 UTC
# Line 78  Line 78 
78    
79  /**  /**
80   * Change the player acceleration.   * Change the player acceleration.
81     * Post an notification named "updatePlayerState" containing the current game
82     * and the current object.
83   */   */
84  - (void) setAcceleration :(float)acceleration  - (void) setAcceleration :(float)acceleration
85  {  {
   [[NSNotificationCenter defaultCenter]  
     postNotificationName:@"updateObject" object: [_player game]];  
   
86    _acceleration = acceleration;    _acceleration = acceleration;
87    
88      [[NSNotificationCenter defaultCenter]
89        postNotificationName: @"updatePlayerState"
90                      object: [_player game]
91                    userInfo: [NSDictionary dictionaryWithObject: self
92                                                        forKey: @"HgPlayerState"]];
93  }  }
94    
95  /**  /**
# Line 97  Line 102 
102    
103  /**  /**
104   * Change the player direction.   * Change the player direction.
105     * Post an notification named "updatePlayerState" containing the current game
106     * and the current object.
107   */   */
108  - (void) setDirection : (float)direction  - (void) setDirection : (float)direction
109  {  {
   [[NSNotificationCenter defaultCenter]  
     postNotificationName:@"updateObject" object: [_player game]];  
   
110    _direction = direction;    _direction = direction;
111    
112      [[NSNotificationCenter defaultCenter]
113        postNotificationName: @"updatePlayerState"
114                      object: [_player game]
115                    userInfo: [NSDictionary dictionaryWithObject: self
116                                                        forKey: @"HgPlayerState"]];
117  }  }
118    
119    
# Line 135  Line 145 
145    
146  /**  /**
147   * Change the player canonDirection.   * Change the player canonDirection.
148     * Post an notification named "updatePlayerState" containing the current game
149     * and the current object.
150   */   */
151  - (void) setCanonDirection: (float)canonDirection  - (void) setCanonDirection: (float)canonDirection
152  {  {
   [[NSNotificationCenter defaultCenter]  
     postNotificationName:@"updateObject" object: [_player game]];  
   
153    _canonDirection = canonDirection;    _canonDirection = canonDirection;
154    
155      [[NSNotificationCenter defaultCenter]
156        postNotificationName: @"updatePlayerState"
157                      object: [_player game]
158                    userInfo: [NSDictionary dictionaryWithObject: self
159                                                        forKey: @"HgPlayerState"]];
160  }  }
161    
162  /**  /**
# Line 154  Line 169 
169    
170  /**  /**
171   * Change the player canonElevation.   * Change the player canonElevation.
172     * Post an notification named "updatePlayerState" containing the current game
173     * and the current object.
174   */   */
175  - (void) setCanonElevation: (unsigned)canonElevation  - (void) setCanonElevation: (unsigned)canonElevation
176  {  {
   [[NSNotificationCenter defaultCenter]  
     postNotificationName:@"updateObject" object: [_player game]];  
   
177    _canonElevation = canonElevation;    _canonElevation = canonElevation;
178    
179      [[NSNotificationCenter defaultCenter]
180        postNotificationName: @"updatePlayerState"
181                      object: [_player game]
182                    userInfo: [NSDictionary dictionaryWithObject: self
183                                                        forKey: @"HgPlayerState"]];
184  }  }
185    
186  @end  @end
# Line 168  Line 188 
188  @implementation HgPlayerState (NSCoding)  @implementation HgPlayerState (NSCoding)
189    
190  /**  /**
191   * NSCoding protocol   * NSCoding protocol to encode and decode objects
  * to encode and decode objects  
192   */   */
193  - (void)encodeWithCoder: (NSCoder *)encoder  - (void)encodeWithCoder: (NSCoder *)encoder
194  {  {

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26