cocoaTouch/GameSetup.m
changeset 3487 b1d00f1950c8
parent 3479 972ae3ec178a
child 3490 016b3172b645
equal deleted inserted replaced
3486:e1b1a4c18c5b 3487:b1d00f1950c8
   152 
   152 
   153 // unpacks scheme data from the selected scheme.plist to a sequence of engine commands
   153 // unpacks scheme data from the selected scheme.plist to a sequence of engine commands
   154 -(NSInteger) provideScheme:(NSString *)schemeName {
   154 -(NSInteger) provideScheme:(NSString *)schemeName {
   155     NSString *schemePath = [[NSString alloc] initWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),schemeName];
   155     NSString *schemePath = [[NSString alloc] initWithFormat:@"%@/%@.plist",SCHEMES_DIRECTORY(),schemeName];
   156     NSArray *scheme = [[NSArray alloc] initWithContentsOfFile:schemePath];
   156     NSArray *scheme = [[NSArray alloc] initWithContentsOfFile:schemePath];
       
   157     [schemePath release];
   157     int result = 0;
   158     int result = 0;
   158     int i = 0;
   159     int i = 0;
   159     
   160     
   160     if ([[scheme objectAtIndex:i++] boolValue])
   161     if ([[scheme objectAtIndex:i++] boolValue])
   161         result |= 0x01;
   162         result |= 0x01;
   229     
   230     
   230     NSString *explosives = [[NSString alloc] initWithFormat:@"e$explosives %d",[[scheme objectAtIndex:i++] intValue]];
   231     NSString *explosives = [[NSString alloc] initWithFormat:@"e$explosives %d",[[scheme objectAtIndex:i++] intValue]];
   231     [self sendToEngine:explosives];
   232     [self sendToEngine:explosives];
   232     [explosives release];
   233     [explosives release];
   233     
   234     
       
   235     [scheme release];
   234     return result;
   236     return result;
   235 }
   237 }
   236 
   238 
   237 // method that handles net setup with engine and keeps connection alive
   239 // method that handles net setup with engine and keeps connection alive
   238 -(void) engineProtocol {
   240 -(void) engineProtocol {