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