59 |
} |
} |
60 |
|
|
61 |
/** |
/** |
62 |
|
* Initialize a new game, with an existing game. |
63 |
|
*/ |
64 |
|
- (id) initWithGame: (HgGame *)game |
65 |
|
{ |
66 |
|
NSParameterAssert(game); |
67 |
|
|
68 |
|
self = [super init]; |
69 |
|
if (self != nil) |
70 |
|
{ |
71 |
|
_name = RETAIN([game name]); |
72 |
|
_players = [[NSMutableArray alloc] initWithArray: [game players]]; |
73 |
|
_teams = [[NSMutableArray alloc] initWithArray: [game teams]]; |
74 |
|
_map = nil; |
75 |
|
_objects = [[NSMutableArray alloc] initWithArray: [game objects]]; |
76 |
|
} |
77 |
|
|
78 |
|
return self; |
79 |
|
} |
80 |
|
|
81 |
|
/** |
82 |
* Dealloc the current game. |
* Dealloc the current game. |
83 |
*/ |
*/ |
84 |
- (void) dealloc |
- (void) dealloc |
218 |
return _objects; |
return _objects; |
219 |
} |
} |
220 |
|
|
221 |
|
/** |
222 |
|
* |
223 |
|
*/ |
224 |
|
- (void) modifWithGame: (HgGame *)game |
225 |
|
{ |
226 |
|
NSParameterAssert (game); |
227 |
|
|
228 |
|
[_name setString: [game name]]; |
229 |
|
[_players setArray: [game players]]; |
230 |
|
[_teams setArray: [game teams]]; |
231 |
|
_map = [game map]; |
232 |
|
[_objects setArray: [game objects]]; |
233 |
|
} |
234 |
|
|
235 |
@end |
@end |
236 |
|
|
237 |
|
|