project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h
changeset 5155 f2165724605c
parent 5154 851f36579ed4
child 6265 a6944f94c19f
--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h	Sun Apr 17 20:52:56 2011 +0200
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.h	Sun Apr 17 22:38:24 2011 +0200
@@ -22,25 +22,34 @@
 #import <Foundation/Foundation.h>
 #import "SDL_net.h"
 
+@protocol EngineProtocolDelegate <NSObject>
+
+-(void) gameHasEndedWithStats:(NSArray *)stats;
+
+@end
+
 @interface EngineProtocolNetwork : NSObject {
-    NSMutableArray *statsArray;
-    NSString *savePath;
-    NSDictionary *gameConfig;
+    id<EngineProtocolDelegate> delegate;
 
+    NSOutputStream *stream;
     NSInteger ipcPort;              // Port on which engine will listen
     TCPsocket csd;                  // Client socket descriptor
 }
 
-@property (nonatomic,retain) NSMutableArray *statsArray;
-@property (nonatomic,retain) NSString *savePath;
-@property (nonatomic,retain) NSDictionary *gameConfig;
+@property (nonatomic,assign) id<EngineProtocolDelegate> delegate;
+@property (nonatomic,retain) NSOutputStream *stream;
 @property (assign) NSInteger ipcPort;
 @property (assign) TCPsocket csd;
 
 
 -(id)   init;
--(void) engineProtocol;
--(void) spawnThreadOnPort:(NSInteger) port;
+-(id)   initOnPort:(NSInteger) port;
+
+-(void) spawnThread:(NSString *)onSaveFile;
+-(void) spawnThread:(NSString *)onSaveFile withOptions:(NSDictionary *)dictionary;
+-(void) engineProtocol:(id) object;
+-(void) gameHasEndedWithStats:(NSArray *)stats;
+
 -(int)  sendToEngine:(NSString *)string;
 -(int)  sendToEngineNoSave:(NSString *)string;
 -(void) provideTeamData:(NSString *)teamName forHogs:(NSInteger) numberOfPlayingHogs withHealth:(NSInteger) initialHealth ofColor:(NSNumber *)teamColor;