20 |
20 |
21 |
21 |
22 #import <Foundation/Foundation.h> |
22 #import <Foundation/Foundation.h> |
23 #import "SDL_net.h" |
23 #import "SDL_net.h" |
24 |
24 |
25 @protocol EngineProtocolDelegate <NSObject> |
|
26 |
|
27 -(void) gameHasEndedWithStats:(NSArray *)stats; |
|
28 |
|
29 @end |
|
30 |
25 |
31 @interface EngineProtocolNetwork : NSObject { |
26 @interface EngineProtocolNetwork : NSObject { |
32 id<EngineProtocolDelegate> delegate; |
27 NSArray *statsArray; |
33 |
|
34 NSOutputStream *stream; |
28 NSOutputStream *stream; |
35 TCPsocket csd; |
29 TCPsocket csd; |
36 NSInteger enginePort; |
30 NSInteger enginePort; |
37 } |
31 } |
38 |
32 |
39 @property (nonatomic,assign) id<EngineProtocolDelegate> delegate; |
33 @property (nonatomic,assign) NSArray *statsArray; |
40 @property (nonatomic,retain) NSOutputStream *stream; |
34 @property (nonatomic,retain) NSOutputStream *stream; |
41 @property (assign) TCPsocket csd; |
35 @property (assign) TCPsocket csd; |
42 @property (assign) NSInteger enginePort; |
36 @property (assign) NSInteger enginePort; |
43 |
37 |
44 |
38 |
45 -(id) init; |
39 -(id) init; |
46 |
40 |
47 +(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary; |
41 -(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary; |
48 +(NSInteger) activeEnginePort; |
42 +(NSInteger) activeEnginePort; |
49 |
43 |
50 -(void) engineProtocol:(id) object; |
44 -(void) engineProtocol:(id) object; |
51 -(void) gameHasEndedWithStats:(NSArray *)stats; |
|
52 |
45 |
53 -(int) sendToEngine:(NSString *)string; |
46 -(int) sendToEngine:(NSString *)string; |
54 -(int) sendToEngineNoSave:(NSString *)string; |
47 -(int) sendToEngineNoSave:(NSString *)string; |
55 -(void) provideTeamData:(NSString *)teamName forHogs:(NSInteger) numberOfPlayingHogs withHealth:(NSInteger) initialHealth ofColor:(NSNumber *)teamColor; |
48 -(void) provideTeamData:(NSString *)teamName forHogs:(NSInteger) numberOfPlayingHogs withHealth:(NSInteger) initialHealth ofColor:(NSNumber *)teamColor; |
56 -(void) provideAmmoData:(NSString *)ammostoreName forPlayingTeams:(NSInteger) numberOfTeams; |
49 -(void) provideAmmoData:(NSString *)ammostoreName forPlayingTeams:(NSInteger) numberOfTeams; |