project_files/HedgewarsMobile/Classes/CreationChamber.m
author koda
Sat, 08 Oct 2011 21:17:24 +0200
changeset 6103 55ecfbf834e3
parent 5984 6fd40d866342
child 6104 117bdf4e7af9
permissions -rw-r--r--
convert creation chamber functions to class methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     1
/*
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
4976
088d40d8aba2 Happy 2011 :)
koda
parents: 4950
diff changeset
     3
 * Copyright (c) 2009-2011 Vittorio Giovara <vittorio.giovara@gmail.com>
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     4
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     8
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    12
 * GNU General Public License for more details.
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    13
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    17
 *
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    18
 * File created on 12/11/2010.
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    19
 */
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    20
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    21
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    22
#import "CreationChamber.h"
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
    23
#import "hwconsts.h"
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
    24
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    25
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    26
@implementation CreationChamber
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    27
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    28
#pragma mark Settings
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    29
+(void) createSettings {
5206
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    30
    NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    31
    [settings setObject:[NSNumber numberWithBool:NO] forKey:@"alternate"];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    32
    [settings setObject:[NSNumber numberWithBool:YES] forKey:@"music"];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    33
    [settings setObject:[NSNumber numberWithBool:YES] forKey:@"sound"];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    34
    [settings setObject:[NSNumber numberWithBool:NO] forKey:@"classic_menu"];
5451
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5376
diff changeset
    35
    [settings setObject:[NSNumber numberWithBool:YES] forKey:@"sync_ws"];
e359a79e3d08 rip out the sync weapons/schemes switch and place it into settings; also perform some runtime check on what can be enabled
koda
parents: 5376
diff changeset
    36
5207
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    37
    // don't overwrite these two strings when present
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    38
    if ([settings objectForKey:@"username"] == nil)
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    39
        [settings setObject:@"" forKey:@"username"];
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    40
    if ([settings objectForKey:@"password"] == nil)
4c9ae0f484da some general tweaks (more intelligent use of macros and more caching)
koda
parents: 5206
diff changeset
    41
        [settings setObject:@"" forKey:@"password"];
5206
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    42
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    43
    [settings synchronize];
db775bddf771 settings.plist is no more, long live nsuserdefaults
koda
parents: 5200
diff changeset
    44
}
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    45
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    46
#pragma mark Teams
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    47
+(void) createTeamNamed:(NSString *)nameWithoutExt {
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    48
    [CreationChamber createTeamNamed:nameWithoutExt ofType:0 controlledByAI:NO];
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    49
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    50
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    51
+(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    52
    [CreationChamber createTeamNamed:nameWithoutExt ofType:type controlledByAI:NO];
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    53
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    54
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    55
+(void) createTeamNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type controlledByAI:(BOOL) flag {
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    56
    NSString *teamsDirectory = TEAMS_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    57
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    58
    if (![[NSFileManager defaultManager] fileExistsAtPath: teamsDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    59
        [[NSFileManager defaultManager] createDirectoryAtPath:teamsDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    60
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    61
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    62
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    63
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    64
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    65
    NSMutableArray *hedgehogs = [[NSMutableArray alloc] initWithCapacity: HW_getMaxNumberOfHogs()];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    66
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    67
    for (int i = 0; i < HW_getMaxNumberOfHogs(); i++) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    68
        NSString *hogName = [[NSString alloc] initWithFormat:@"hedgehog %d",i];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    69
        NSDictionary *hog = [[NSDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    70
                             [NSNumber numberWithInt:0],@"level",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    71
                             hogName,@"hogname",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    72
                             @"NoHat",@"hat",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    73
                             nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    74
        [hogName release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    75
        [hedgehogs addObject:hog];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    76
        [hog release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    77
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    78
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    79
    NSDictionary *theTeam = [[NSDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    80
                             @"0",@"hash",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    81
                             @"Statue",@"grave",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    82
                             @"Plane",@"fort",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    83
                             @"Default",@"voicepack",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    84
                             @"hedgewars",@"flag",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    85
                             hedgehogs,@"hedgehogs",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    86
                             nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    87
    [hedgehogs release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    88
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    89
    NSString *teamFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", teamsDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    90
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    91
    [theTeam writeToFile:teamFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    92
    [teamFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    93
    [theTeam release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    94
}
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
    95
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    96
#pragma mark Weapons
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    97
+(void) createWeaponNamed:(NSString *)nameWithoutExt {
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    98
    [CreationChamber createWeaponNamed:nameWithoutExt ofType:0];
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
    99
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   100
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   101
+(void) createWeaponNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   102
    NSString *weaponsDirectory = WEAPONS_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   103
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   104
    if (![[NSFileManager defaultManager] fileExistsAtPath: weaponsDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   105
        [[NSFileManager defaultManager] createDirectoryAtPath:weaponsDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   106
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   107
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   108
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   109
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   110
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   111
    NSInteger ammolineSize = HW_getNumberOfWeapons();
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   112
    NSString *qt, *prob, *delay, *crate;
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   113
    switch (type) {
4607
7f683c2357a0 update weapons
koda
parents: 4605
diff changeset
   114
        default: //default
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   115
            qt = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_QT length:ammolineSize encoding:NSUTF8StringEncoding];
5376
ea8a74951948 copy pasta fail
koda
parents: 5207
diff changeset
   116
            prob = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
ea8a74951948 copy pasta fail
koda
parents: 5207
diff changeset
   117
            delay = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
ea8a74951948 copy pasta fail
koda
parents: 5207
diff changeset
   118
            crate = [[NSString alloc] initWithBytes:AMMOLINE_DEFAULT_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   119
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   120
        case 1: //crazy
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   121
            qt = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   122
            prob = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   123
            delay = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   124
            crate = [[NSString alloc] initWithBytes:AMMOLINE_CRAZY_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   125
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   126
        case 2: //pro mode
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   127
            qt = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   128
            prob = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   129
            delay = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   130
            crate = [[NSString alloc] initWithBytes:AMMOLINE_PROMODE_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   131
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   132
        case 3: //shoppa
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   133
            qt = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   134
            prob = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   135
            delay = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   136
            crate = [[NSString alloc] initWithBytes:AMMOLINE_SHOPPA_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   137
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   138
        case 4: //clean slate
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   139
            qt = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   140
            prob = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   141
            delay = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   142
            crate = [[NSString alloc] initWithBytes:AMMOLINE_CLEAN_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   143
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   144
        case 5: //minefield
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   145
            qt = [[NSString alloc] initWithBytes:AMMOLINE_MINES_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   146
            prob = [[NSString alloc] initWithBytes:AMMOLINE_MINES_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   147
            delay = [[NSString alloc] initWithBytes:AMMOLINE_MINES_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   148
            crate = [[NSString alloc] initWithBytes:AMMOLINE_MINES_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4284
57a501a69e5f update iFrontend with new schemes and weaps, fix up smaller glitches
koda
parents: 4281
diff changeset
   149
            break;
57a501a69e5f update iFrontend with new schemes and weaps, fix up smaller glitches
koda
parents: 4281
diff changeset
   150
        case 6: //thinking with portals
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   151
            qt = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_QT length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   152
            prob = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_PROB length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   153
            delay = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_DELAY length:ammolineSize encoding:NSUTF8StringEncoding];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   154
            crate = [[NSString alloc] initWithBytes:AMMOLINE_PORTALS_CRATE length:ammolineSize encoding:NSUTF8StringEncoding];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   155
            break;
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   156
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   157
5200
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   158
    NSDictionary *theWeapon = [[NSDictionary alloc] initWithObjectsAndKeys: qt,@"ammostore_initialqt",
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   159
                               prob,@"ammostore_probability", delay,@"ammostore_delay", crate,@"ammostore_crate", nil];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   160
    [qt release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   161
    [prob release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   162
    [delay release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   163
    [crate release];
7440fe992e73 * move ammo lines from .cpp.in to .h so that it is readable from the ios frontend (and who knows, maybe from other frontends as well)
koda
parents: 5185
diff changeset
   164
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   165
    NSString *weaponFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", weaponsDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   166
    [theWeapon writeToFile:weaponFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   167
    [weaponFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   168
    [theWeapon release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   169
}
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   170
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   171
#pragma mark Schemes
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   172
+(void) createSchemeNamed:(NSString *)nameWithoutExt {
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   173
    [CreationChamber createSchemeNamed:nameWithoutExt ofType:0];
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   174
}
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   175
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   176
+(void) createSchemeNamed:(NSString *)nameWithoutExt ofType:(NSInteger) type {
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   177
    NSString *schemesDirectory = SCHEMES_DIRECTORY();
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   178
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   179
    if (![[NSFileManager defaultManager] fileExistsAtPath: schemesDirectory]) {
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   180
        [[NSFileManager defaultManager] createDirectoryAtPath:schemesDirectory
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   181
                                  withIntermediateDirectories:NO
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   182
                                                   attributes:nil
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   183
                                                        error:NULL];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   184
    }
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   185
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   186
    // load data to get the size of the arrays and their default values
5185
7607a64e1853 remove the trailing _en from scheme data and use the macros available instead of creating a string every time
koda
parents: 5181
diff changeset
   187
    NSArray *basicSettings = [[NSArray alloc] initWithContentsOfFile:BASICFLAGS_FILE()];
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   188
    NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithCapacity:[basicSettings count]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   189
    for (NSDictionary *basicDict in basicSettings)
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   190
        [basicArray addObject:[basicDict objectForKey:@"default"]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   191
    [basicSettings release];
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   192
5185
7607a64e1853 remove the trailing _en from scheme data and use the macros available instead of creating a string every time
koda
parents: 5181
diff changeset
   193
    NSArray *mods = [[NSArray alloc] initWithContentsOfFile:GAMEMODS_FILE()];
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   194
    NSMutableArray *gamemodArray= [[NSMutableArray alloc] initWithCapacity:[mods count]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   195
    for (int i = 0; i < [mods count]; i++)
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   196
        [gamemodArray addObject:[NSNumber numberWithBool:NO]];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   197
    [mods release];
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   198
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   199
    switch (type) {
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   200
        case 0: // default
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   201
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   202
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   203
        case 1: // pro mode
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   204
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:15]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   205
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   206
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   207
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   208
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   209
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   210
        case 2: // shoppa
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   211
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   212
            [basicArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithInt:50]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   213
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:1]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   214
            [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   215
            [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:25]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   216
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   217
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   218
            [gamemodArray replaceObjectAtIndex:1 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   219
            [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   220
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   221
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   222
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   223
            [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   224
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   225
        case 3: // clean slate
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   226
            [gamemodArray replaceObjectAtIndex:6 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   227
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   228
            [gamemodArray replaceObjectAtIndex:18 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   229
            [gamemodArray replaceObjectAtIndex:19 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   230
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   231
        case 4: // minefield
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   232
            [basicArray replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:50]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   233
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   234
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   235
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   236
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:80]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   237
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   238
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   239
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   240
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   241
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   242
        case 5: // barrel mayhem
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   243
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   244
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   245
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   246
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   247
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:40]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   248
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   249
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   250
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   251
        case 6: // tunnel hogs
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   252
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   253
            [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:3]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   254
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   255
            [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   256
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   257
            [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   258
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   259
            [gamemodArray replaceObjectAtIndex:14 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   260
            [gamemodArray replaceObjectAtIndex:15 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   261
            [gamemodArray replaceObjectAtIndex:16 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   262
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   263
        case 7: // fort mode
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   264
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   265
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   266
            [gamemodArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   267
            [gamemodArray replaceObjectAtIndex:3 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   268
            [gamemodArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   269
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   270
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   271
        case 8: // timeless
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   272
            [basicArray replaceObjectAtIndex:2 withObject:[NSNumber numberWithInt:100]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   273
            [basicArray replaceObjectAtIndex:4 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   274
            [basicArray replaceObjectAtIndex:5 withObject:[NSNumber numberWithInt:0]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   275
            [basicArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithInt:30]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   276
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:5]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   277
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:3]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   278
            [basicArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithInt:10]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   279
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   280
            [gamemodArray replaceObjectAtIndex:20 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   281
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   282
        case 9: // thinking with portals
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   283
            [basicArray replaceObjectAtIndex:7 withObject:[NSNumber numberWithInt:2]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   284
            [basicArray replaceObjectAtIndex:8 withObject:[NSNumber numberWithInt:25]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   285
            [basicArray replaceObjectAtIndex:10 withObject:[NSNumber numberWithInt:4]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   286
            [basicArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithInt:5]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   287
            [basicArray replaceObjectAtIndex:13 withObject:[NSNumber numberWithInt:5]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   288
            [gamemodArray replaceObjectAtIndex:9 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   289
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   290
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   291
        case 10:// king mode
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   292
            [gamemodArray replaceObjectAtIndex:11 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   293
            [gamemodArray replaceObjectAtIndex:12 withObject:[NSNumber numberWithBool:YES]];
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   294
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   295
        default:
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   296
            DLog(@"Impossible");
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   297
            break;
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   298
    }
5181
102fef5ca5fc add getawaytime and tagteam mode to ios
koda
parents: 4976
diff changeset
   299
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   300
    NSMutableDictionary *theScheme = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   301
                                      basicArray,@"basic",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   302
                                      gamemodArray,@"gamemod",
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   303
                                      nil];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   304
    [gamemodArray release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   305
    [basicArray release];
5984
6fd40d866342 create the ios schemes programmatically
koda
parents: 5664
diff changeset
   306
4281
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   307
    NSString *schemeFile = [[NSString alloc] initWithFormat:@"%@/%@.plist", schemesDirectory, nameWithoutExt];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   308
    
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   309
    [theScheme writeToFile:schemeFile atomically:YES];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   310
    [schemeFile release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   311
    [theScheme release];
e033cf015b2c redo once again file updating, moving stuff around
koda
parents:
diff changeset
   312
}
6103
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   313
55ecfbf834e3 convert creation chamber functions to class methods
koda
parents: 5984
diff changeset
   314
@end