22 |
*/ |
*/ |
23 |
|
|
24 |
#include <Foundation/NSObject.h> |
#include <Foundation/NSObject.h> |
25 |
|
#include <Foundation/NSException.h> |
26 |
|
|
27 |
#include "Interface/UiImage.h" |
#include "Interface/UiImage.h" |
28 |
#include "Interface/UiButton.h" |
#include "Interface/UiButton.h" |
32 |
#include "GameWidget.h" |
#include "GameWidget.h" |
33 |
#include "JoinFrame.h" |
#include "JoinFrame.h" |
34 |
|
|
35 |
|
#include "PlayerNameController.h" |
36 |
|
|
37 |
@interface JoinController : NSObject |
@interface JoinController : NSObject |
38 |
{ |
{ |
39 |
@private |
@private |
48 |
|
|
49 |
- (id) initWithView: (JoinFrame *)view |
- (id) initWithView: (JoinFrame *)view |
50 |
{ |
{ |
51 |
|
NSParameterAssert (view); |
52 |
|
|
53 |
self = [super init]; |
self = [super init]; |
54 |
if (self != nil) |
if (self != nil) |
55 |
{ |
{ |
81 |
|
|
82 |
- (id) initWithInterface: (Interface *)interface |
- (id) initWithInterface: (Interface *)interface |
83 |
{ |
{ |
84 |
|
NSParameterAssert (interface); |
85 |
|
|
86 |
self = [super initWithInterface: interface]; |
self = [super initWithInterface: interface]; |
87 |
if (self != nil) |
if (self != nil) |
88 |
{ |
{ |
96 |
UiButton *joinButton |
UiButton *joinButton |
97 |
= [[UiButton alloc] initWithText: @"join game" |
= [[UiButton alloc] initWithText: @"join game" |
98 |
position: NSMakePoint (200.0f, 200.0f)]; |
position: NSMakePoint (200.0f, 200.0f)]; |
99 |
|
|
100 |
|
UiTextField *playerName |
101 |
|
= [[UiTextField alloc] |
102 |
|
initWithText: [NSString stringWithCString: "nom joueur"] |
103 |
|
position: NSMakePoint (600.0f, 200.0f) |
104 |
|
height: 18]; |
105 |
|
|
106 |
|
PlayerNameController *playerNameController |
107 |
|
= [[PlayerNameController alloc] initWithPlayerName: playerName]; |
108 |
|
|
109 |
[joinButton setDelegate: controller]; |
[joinButton setDelegate: controller]; |
110 |
|
[playerName setDelegate: playerNameController]; |
111 |
|
|
112 |
[self addWidget: logo]; |
[self addWidget: logo]; |
113 |
[self addWidget: joinButton]; |
[self addWidget: joinButton]; |
114 |
|
[self addWidget: playerName]; |
115 |
|
|
116 |
RELEASE(logo); |
RELEASE(logo); |
117 |
RELEASE(joinButton); |
RELEASE(joinButton); |
118 |
RELEASE(controller); |
RELEASE(controller); |
119 |
|
RELEASE(playerName); |
120 |
} |
} |
121 |
|
|
122 |
return self; |
return self; |