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

Diff of /hegemonie/GameEngine/HgObject.m

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

revision 1.6 by thunder, Tue Jul 22 12:44:38 2003 UTC revision 1.7 by nicov, Fri Jul 25 13:48:44 2003 UTC
# Line 24  Line 24 
24  #include <Foundation/NSException.h>  #include <Foundation/NSException.h>
25  #include <Foundation/NSCoder.h>  #include <Foundation/NSCoder.h>
26  #include <Foundation/NSValue.h>  #include <Foundation/NSValue.h>
27    #include <Foundation/NSNotification.h>
28    
29  #include "GameEngine/HgObject.h"  #include "GameEngine/HgObject.h"
30  #include "GameEngine/HgGame.h"  #include "GameEngine/HgGame.h"
31    
32    
33  /**  /**
34   * HgObject stores all principal caracteritic wich belongs to the   * HgObject stores all principal caracteritic wich belongs to the
35   * current object. This class is abstract and must be redefined   * current object. This class is abstract and must be redefined
# Line 36  Line 38 
38  @implementation HgObject  @implementation HgObject
39    
40  /**  /**
41   * Initialyse an object which will be contained in game.   * Initialise an object which will be contained in game.
42   * The position must be contained in the game map.   * The position must be contained in the game map.
43   */   */
44  - (id) initWithGame: (HgGame *)game  - (id) initWithGame: (HgGame *)game
# Line 99  Line 101 
101  /**  /**
102   * Set the current position of the object.   * Set the current position of the object.
103   * The position must be contained in the map.   * The position must be contained in the map.
104     * Post an notification named "updateObject" containing the current object.
105   */   */
106  - (void) setPosition: (coord_t)position  - (void) setPosition: (coord_t)position
107  {  {
# Line 107  Line 110 
110     */     */
111    //[_position mapContainsPosition: position]    //[_position mapContainsPosition: position]
112    
113      [[NSNotificationCenter defaultCenter]
114        postNotificationName:@"updateObject" object:self];
115      
116    _position = position;    _position = position;
117  }  }
118    
# Line 120  Line 126 
126    
127  /**  /**
128   * Set the orientation of the object.   * Set the orientation of the object.
129     * Post an notification named "updateObject" containing the current object.
130   */   */
131  - (void) setOrientation: (coord_t)orientation  - (void) setOrientation: (coord_t)orientation
132  {  {
133      [[NSNotificationCenter defaultCenter]
134        postNotificationName:@"updateObject" object:self];
135    
136    _orientation = orientation;    _orientation = orientation;
137  }  }
138    
# Line 172  Line 182 
182    NSNumber *numIdent = [NSNumber numberWithInt: _identifier];    NSNumber *numIdent = [NSNumber numberWithInt: _identifier];
183    
184    HgGame *current = [HgGame currentGame];    HgGame *current = [HgGame currentGame];
185    HgObject *object = [[current players] objectForKey: numIdent];    HgObject *object = [[current objects] objectForKey: numIdent];
186    
187    if (object != nil)    if (object != nil)
188      {      {

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