19 |
19 |
20 #import <Foundation/Foundation.h> |
20 #import <Foundation/Foundation.h> |
21 #import "SDL_net.h" |
21 #import "SDL_net.h" |
22 |
22 |
23 |
23 |
|
24 @protocol EngineProtocolDelegate <NSObject> |
|
25 |
|
26 -(void) gameEndedWithStatistics:(NSArray *)stats; |
|
27 |
|
28 @end |
|
29 |
|
30 |
24 @interface EngineProtocolNetwork : NSObject { |
31 @interface EngineProtocolNetwork : NSObject { |
25 NSMutableArray *statsArray; |
32 id<EngineProtocolDelegate> delegate; |
26 NSOutputStream *stream; |
33 NSOutputStream *stream; |
27 TCPsocket csd; |
34 TCPsocket csd; |
28 NSInteger enginePort; |
35 NSInteger enginePort; |
29 } |
36 } |
30 |
37 |
31 @property (nonatomic,assign) NSMutableArray *statsArray; |
38 @property (nonatomic,assign) id<EngineProtocolDelegate> delegate; |
32 @property (nonatomic,retain) NSOutputStream *stream; |
39 @property (nonatomic,retain) NSOutputStream *stream; |
33 @property (assign) TCPsocket csd; |
40 @property (assign) TCPsocket csd; |
34 @property (assign) NSInteger enginePort; |
41 @property (assign) NSInteger enginePort; |
35 |
42 |
36 -(id) init; |
43 -(id) init; |
|
44 -(id) initWithPort:(NSInteger) port; |
37 -(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary; |
45 -(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary; |
38 -(void) engineProtocol:(id) object; |
46 -(void) engineProtocol:(id) object; |
39 |
47 |
40 -(int) sendToEngine:(NSString *)string; |
48 -(int) sendToEngine:(NSString *)string; |
41 -(int) sendToEngineNoSave:(NSString *)string; |
49 -(int) sendToEngineNoSave:(NSString *)string; |