QTfrontend/ammoSchemeModel.cpp
changeset 1974 77a9416ceead
parent 1968 f32b18c5d495
child 2017 7845c77c8d31
equal deleted inserted replaced
1973:e30417559e69 1974:77a9416ceead
    39 		<< QVariant(5)             // case prob      13
    39 		<< QVariant(5)             // case prob      13
    40 		;
    40 		;
    41 
    41 
    42 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
    42 AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
    43 	QAbstractTableModel(parent),
    43 	QAbstractTableModel(parent),
    44 	numberOfDefaultSchemes(3),
    44 	numberOfDefaultSchemes(4),
    45 	fileConfig(fileName, QSettings::IniFormat)
    45 	fileConfig(fileName, QSettings::IniFormat)
    46 {
    46 {
    47 	QStringList predefSchemesNames;
    47 	QStringList predefSchemesNames;
    48 	predefSchemesNames
    48 	predefSchemesNames
    49 		<< "Default"
    49 		<< "Default"
    50 		<< "Pro mode"
    50 		<< "Pro mode"
    51 		<< "Shoppa";
    51 		<< "Shoppa"
       
    52 		<< "Basketball";
    52 	
    53 	
    53 	spNames = QStringList()
    54 	spNames = QStringList()
    54 		<< "name"             //  0
    55 		<< "name"             //  0
    55 		<< "fortsmode"        //  1
    56 		<< "fortsmode"        //  1
    56 		<< "divteams"         //  2
    57 		<< "divteams"         //  2
    98 		<< QVariant(false)         // add mines      8
    99 		<< QVariant(false)         // add mines      8
    99 		<< QVariant(100)           // damage modfier 9
   100 		<< QVariant(100)           // damage modfier 9
   100 		<< QVariant(30)            // turn time      10
   101 		<< QVariant(30)            // turn time      10
   101 		<< QVariant(100)           // init health    11
   102 		<< QVariant(100)           // init health    11
   102 		<< QVariant(50)            // sudden death   12
   103 		<< QVariant(50)            // sudden death   12
       
   104 		<< QVariant(1)             // case prob      13
       
   105 		;
       
   106 
       
   107 	QList<QVariant> basketball;
       
   108 	basketball
       
   109 		<< predefSchemesNames[3]   // name           0
       
   110 		<< QVariant(false)         // fortsmode      1
       
   111 		<< QVariant(false)         // team divide    2
       
   112 		<< QVariant(true)          // solid land     3
       
   113 		<< QVariant(true)          // border         4
       
   114 		<< QVariant(true)          // low gravity    5
       
   115 		<< QVariant(false)         // laser sight    6
       
   116 		<< QVariant(true)          // invulnerable   7
       
   117 		<< QVariant(false)         // add mines      8
       
   118 		<< QVariant(100)           // damage modfier 9
       
   119 		<< QVariant(30)            // turn time      10
       
   120 		<< QVariant(100)           // init health    11
       
   121 		<< QVariant(15)            // sudden death   12
   103 		<< QVariant(0)             // case prob      13
   122 		<< QVariant(0)             // case prob      13
   104 		;
   123 		;
   105 
   124 
   106 	schemes.append(defaultScheme);
   125 	schemes.append(defaultScheme);
   107 	schemes.append(proMode);
   126 	schemes.append(proMode);
   108 	schemes.append(shoppa);
   127 	schemes.append(shoppa);
       
   128 	schemes.append(basketball);
   109 
   129 
   110 
   130 
   111 	int size = fileConfig.beginReadArray("schemes");
   131 	int size = fileConfig.beginReadArray("schemes");
   112 	for (int i = 0; i < size; ++i) {
   132 	for (int i = 0; i < size; ++i) {
   113 		fileConfig.setArrayIndex(i);
   133 		fileConfig.setArrayIndex(i);