/[hegemonie]/hegemonie/Source/JoinFrame.m
ViewVC logotype

Diff of /hegemonie/Source/JoinFrame.m

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

revision 1.1 by zaral, Fri Jul 25 15:29:17 2003 UTC revision 1.2 by dam, Mon Jul 28 14:47:20 2003 UTC
# Line 26  Line 26 
26  #include "Interface/UiImage.h"  #include "Interface/UiImage.h"
27  #include "Interface/UiButton.h"  #include "Interface/UiButton.h"
28    
29    #include "Interface.h"
30    #include "GameFrame.h"
31    #include "GameWidget.h"
32  #include "JoinFrame.h"  #include "JoinFrame.h"
33    
34  @interface JoinController : NSObject  @interface JoinController : NSObject
# Line 35  Line 38 
38  }  }
39    
40  - (id) initWithView: (JoinFrame *)view;  - (id) initWithView: (JoinFrame *)view;
41  - (void) actionImplemented;  - (void) actionPerformed;
42  @end  @end
43    
44  @implementation JoinController  @implementation JoinController
# Line 58  Line 61 
61    [super dealloc];    [super dealloc];
62  }  }
63    
64  - (void) actionImplemented  - (void) actionPerformed
65  {  {
66      Interface *interface = [_view interface];
67    
68    /* FIXME - start game */    /* FIXME - start game */
69    //  [_interface setCurrentFrame: [_interface createFrame]];    [[[interface gameFrame] gameWidget] newGame];
70      [interface setCurrentFrame: [interface gameFrame]];
71  }  }
72    
73  @end  @end
74    
75  @implementation JoinFrame  @implementation JoinFrame
76    
77  - (id) init  - (id) initWithInterface: (Interface *)interface
78  {  {
79    self = [super initWithParent: nil];    self = [super initWithInterface: interface];
80    if (self != nil)    if (self != nil)
81      {      {
82        JoinController *controller = [[JoinController alloc] initWithView: self];        JoinController *controller = [[JoinController alloc] initWithView: self];
83        [self setDelegate: controller];        [self setDelegate: controller];
84        RELEASE (controller);        RELEASE (controller);
85    
86        _logo = [[UiImage alloc] initWithImageName: @"logo.tiff"        UiImage *logo
87                                          position: NSMakePoint (200, 200)];          = [[UiImage alloc] initWithImageName: @"logo.png"
88        [_logo setSize: NSMakeSize (600.0, 300)];                                      position: NSMakePoint (60, 650)];
89        
90        _joinButton        UiButton *joinButton
91          = [[UiButton alloc] initWithText: @"bouton"          = [[UiButton alloc] initWithText: @"join game"
92                                  position: NSMakePoint (200.0f, 200.0f)];                                  position: NSMakePoint (200.0f, 200.0f)];
93          [joinButton setDelegate: controller];
94                
95        [self addWidget: _logo];        [self addWidget: logo];
96        [self addWidget: _joinButton];        [self addWidget: joinButton];
97    
98          RELEASE(logo);
99          RELEASE(joinButton);
100      }      }
101    
102    return self;    return self;
103  }  }
104    
105  - (void) dealloc  - (Interface *)interface
106  {  {
107    RELEASE(_logo);    return (Interface *)[super interface];
   RELEASE(_joinButton);  
   
   [super dealloc];  
108  }  }
109    
110  @end  @end

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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