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

Diff of /hegemonie/GameEngine/HgShip.m

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

revision 1.6 by thunder, Tue Jul 22 13:06:06 2003 UTC revision 1.7 by thunder, Wed Aug 13 16:35:37 2003 UTC
# Line 25  Line 25 
25  #include <Foundation/NSArray.h>  #include <Foundation/NSArray.h>
26  #include <Foundation/NSException.h>  #include <Foundation/NSException.h>
27  #include <Foundation/NSCoder.h>  #include <Foundation/NSCoder.h>
28    #include <Foundation/NSNotification.h>
29    
30  #include "GameEngine/HgShip.h"  #include "GameEngine/HgShip.h"
31  #include "GameEngine/HgBonus.h"  #include "GameEngine/HgBonus.h"
# Line 57  Line 58 
58   */   */
59  - (void) setFuel: (unsigned)fuel  - (void) setFuel: (unsigned)fuel
60  {  {
61      [[NSNotificationCenter defaultCenter]
62        postNotificationName:@"updateObject" object: [self game]];
63    
64    _fuel = fuel;    _fuel = fuel;
65  }  }
66    
# Line 78  Line 82 
82   */   */
83  - (void) setFireRate: (unsigned)fireRate  - (void) setFireRate: (unsigned)fireRate
84  {  {
85      [[NSNotificationCenter defaultCenter]
86        postNotificationName:@"updateObject" object: [self game]];
87    
88    _fireRate = fireRate;    _fireRate = fireRate;
89  }  }
90    
# Line 118  Line 125 
125    NSParameterAssert (bonus);    NSParameterAssert (bonus);
126    NSParameterAssert (![_bonuses containsObject: bonus]);    NSParameterAssert (![_bonuses containsObject: bonus]);
127    
128      [[NSNotificationCenter defaultCenter]
129        postNotificationName:@"updateObject" object: [self game]];
130    
131    [_bonuses addObject: bonus];    [_bonuses addObject: bonus];
132  }  }
133    
# Line 130  Line 140 
140    NSParameterAssert (bonus);    NSParameterAssert (bonus);
141    NSParameterAssert ([_bonuses containsObject: bonus]);    NSParameterAssert ([_bonuses containsObject: bonus]);
142        
143      [[NSNotificationCenter defaultCenter]
144        postNotificationName:@"updateObject" object: [self game]];
145    
146    [_bonuses removeObject: bonus];    [_bonuses removeObject: bonus];
147  }  }
148    
# Line 146  Line 159 
159   */   */
160  - (void) setNbAmmo: (unsigned)nbAmmo  - (void) setNbAmmo: (unsigned)nbAmmo
161  {  {
162      [[NSNotificationCenter defaultCenter]
163        postNotificationName:@"updateObject" object: [self game]];
164    
165    _ammo = nbAmmo;    _ammo = nbAmmo;
166  }  }
167    
# Line 154  Line 170 
170   */   */
171  - (void) useAmmos: (unsigned)quantity  - (void) useAmmos: (unsigned)quantity
172  {  {
173      [[NSNotificationCenter defaultCenter]
174        postNotificationName:@"updateObject" object: [self game]];
175    
176    _ammo = (_ammo - quantity);    _ammo = (_ammo - quantity);
177  }  }
178    
# Line 162  Line 181 
181   */   */
182  - (void) addAmmos: (unsigned)quantity  - (void) addAmmos: (unsigned)quantity
183  {  {
184      [[NSNotificationCenter defaultCenter]
185        postNotificationName:@"updateObject" object: [self game]];
186    
187    _ammo = (_ammo + quantity);    _ammo = (_ammo + quantity);
188  }  }
189    
190    @end
191    
192    @implementation HgShip (NSCoding)
193    
194  /**  /**
195   * NSCoding method   * NSCoding method
196   * to encode and decode objects   * to encode and decode objects

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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