27 |
#include "GameEngine/HgWeapon.h" |
#include "GameEngine/HgWeapon.h" |
28 |
|
|
29 |
/** |
/** |
30 |
* Hgweapons stores all caracteristic of weapons. |
* HgWeapons stores all caracteristic of weapons. |
31 |
* Weapons are mobileObject with a time to life (ttl). |
* Weapons are mobileObject with a time to life (ttl). |
32 |
* This class is abstract and must be redefined by a subclass to make |
* This class is abstract and must be redefined by a subclass to make |
33 |
* a "real" weapon. |
* a "real" weapon. |
34 |
*/ |
*/ |
35 |
@implementation HgWeapon |
@implementation HgWeapon |
36 |
|
|
37 |
|
/** |
38 |
|
* Returns the fire rate of the weapon. |
39 |
|
* This method is abstract and must be redefined by concrete subclasses. |
40 |
|
*/ |
41 |
|
+ (unsigned) fireRate |
42 |
|
{ |
43 |
|
[self subclassResponsibility: _cmd]; |
44 |
|
return 0; |
45 |
|
} |
46 |
|
|
47 |
|
/** |
48 |
|
* Returns the damage of the weapon. |
49 |
|
* This method is abstract and must be redefined by concrete subclasses. |
50 |
|
*/ |
51 |
|
+ (unsigned) damage |
52 |
|
{ |
53 |
|
[self subclassResponsibility: _cmd]; |
54 |
|
return 0; |
55 |
|
} |
56 |
|
|
57 |
/** |
/** |
58 |
* The contructeur is the same as HgMobile. |
* The contructor is the same as HgMobile. |
59 |
*/ |
*/ |
60 |
|
|
61 |
/** |
/** |
73 |
*/ |
*/ |
74 |
- (void) setTtl: (unsigned)ttl |
- (void) setTtl: (unsigned)ttl |
75 |
{ |
{ |
76 |
_ttl=ttl; |
_ttl = ttl; |
77 |
|
|
78 |
[[NSNotificationCenter defaultCenter] postNotificationName: @"updateObject" |
[[NSNotificationCenter defaultCenter] postNotificationName: @"updateObject" |
79 |
object: [self game] |
object: [self game] |