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

Diff of /hegemonie/GameEngine/HgTeam.m

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

revision 1.9 by nicov, Fri Jul 25 13:48:59 2003 UTC revision 1.10 by nicov, Wed Aug 13 15:53:01 2003 UTC
# Line 37  Line 37 
37  @implementation HgTeam  @implementation HgTeam
38    
39  /**  /**
40   * Initialize a new team, with a given name.   * Initialize a new team, with a given name and the game.
41   */   */
42  - (id) initWithName: (NSString *)name  - (id) initWithName: (NSString *)name
43                   game: (HgGame *)  game
44  {  {
45    /*    /*
46     * FIXME - overflow risk     * FIXME - overflow risk
# Line 48  Line 49 
49    
50    NSParameterAssert (name);    NSParameterAssert (name);
51    NSParameterAssert ([name length] != 0);    NSParameterAssert ([name length] != 0);
52      NSParameterAssert (game);
53    
54    self = [super init];    self = [super init];
55    if (self != nil)    if (self != nil)
# Line 56  Line 58 
58        _name = RETAIN(name);        _name = RETAIN(name);
59        _maxPlayers = 0;        _maxPlayers = 0;
60        _players = [[NSMutableArray alloc] init];        _players = [[NSMutableArray alloc] init];
61          _game = game;
62      }      }
63        
64    return self;    return self;
# Line 68  Line 71 
71  {  {
72    RELEASE(_name);    RELEASE(_name);
73    RELEASE(_players);    RELEASE(_players);
74      RELEASE(_game);
75    
76    [super dealloc];    [super dealloc];
77  }  }
# Line 142  Line 146 
146    [decoder decodeValueOfObjCType: "I" at: &_identifier];    [decoder decodeValueOfObjCType: "I" at: &_identifier];
147    NSNumber *numIdent = [NSNumber numberWithInt: _identifier];    NSNumber *numIdent = [NSNumber numberWithInt: _identifier];
148    
149    HgGame *current = [HgGame currentGame];    HgTeam *teamObject = [[_game teams] objectForKey: numIdent];
   HgTeam *teamObject = [[current teams] objectForKey: numIdent];  
150    
151    if (teamObject != nil)    if (teamObject != nil)
152      {      {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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