47 |
|
|
48 |
/** |
/** |
49 |
* Set the bonus ttl. |
* Set the bonus ttl. |
50 |
|
* Post an notification named "updateObject" containing the current game and |
51 |
|
* the current object. |
52 |
*/ |
*/ |
53 |
- (void) setTtl: (unsigned)ttl |
- (void) setTtl: (unsigned)ttl |
54 |
{ |
{ |
|
[[NSNotificationCenter defaultCenter] |
|
|
postNotificationName:@"updateObject" object: [self game]]; |
|
|
|
|
55 |
_ttl = ttl; |
_ttl = ttl; |
56 |
|
|
57 |
|
[[NSNotificationCenter defaultCenter] postNotificationName: @"updateObject" |
58 |
|
object: [self game] |
59 |
|
userInfo: [NSDictionary dictionaryWithObject: self |
60 |
|
forKey: @"HgObject"]]; |
61 |
} |
} |
62 |
|
|
63 |
- (void) updateTtl |
- (void) updateTtl |
68 |
/** |
/** |
69 |
* Change the bonus value. This is an abstract class, and must be |
* Change the bonus value. This is an abstract class, and must be |
70 |
* redefined by subclasses to actually do something. |
* redefined by subclasses to actually do something. |
71 |
|
* Post an notification named "updateObject" containing the current game and |
72 |
|
* the current object. |
73 |
*/ |
*/ |
74 |
- (void) activate: (BOOL)state |
- (void) activate: (BOOL)state |
75 |
{ |
{ |
|
[[NSNotificationCenter defaultCenter] |
|
|
postNotificationName:@"updateObject" object: [self game]]; |
|
|
|
|
76 |
_activated = state; |
_activated = state; |
77 |
|
|
78 |
|
[[NSNotificationCenter defaultCenter] postNotificationName: @"updateObject" |
79 |
|
object: [self game] |
80 |
|
userInfo: [NSDictionary dictionaryWithObject: self |
81 |
|
forKey: @"HgObject"]]; |
82 |
} |
} |
83 |
|
|
84 |
/** |
/** |
94 |
@implementation HgBonus (NSCoding) |
@implementation HgBonus (NSCoding) |
95 |
|
|
96 |
/** |
/** |
97 |
* NSCoding method |
* NSCoding method to encode and decode objects |
|
* to encode and decode objects |
|
98 |
*/ |
*/ |
99 |
- (void)encodeWithCoder: (NSCoder *)encoder |
- (void)encodeWithCoder: (NSCoder *)encoder |
100 |
{ |
{ |