QTfrontend/mission.cpp
changeset 14525 029f40c609b4
parent 14463 bd1db668b7c0
equal deleted inserted replaced
14524:b5618fa33a49 14525:029f40c609b4
    51 {
    51 {
    52     QSettings* teamfile = getMissionTeamFile(missionName, teamName);
    52     QSettings* teamfile = getMissionTeamFile(missionName, teamName);
    53     bool won = teamfile->value("Mission " + missionName + "/Won", false).toBool();
    53     bool won = teamfile->value("Mission " + missionName + "/Won", false).toBool();
    54     return won;
    54     return won;
    55 }
    55 }
       
    56 
       
    57 /**
       
    58     Returns true if the mission value adressed with the provided
       
    59     missionName: Name of the mission in question
       
    60     teamName: Name of the playing team
       
    61     key: name of key to check
       
    62 */
       
    63 bool missionValueExists(QString & missionName, QString & teamName, QString key)
       
    64 {
       
    65     QSettings* teamfile = getMissionTeamFile(missionName, teamName);
       
    66     return teamfile->contains("Mission " + missionName + "/" + key);
       
    67 }
       
    68 /**
       
    69     Returns a mission value.
       
    70     NOTE: Check whether the mission value exists first, using missionValueExists.
       
    71     missionName: Name of the mission in question
       
    72     teamName: Name of the playing team
       
    73     key: name of key to read its value from
       
    74 */
       
    75 QVariant getMissionValue(QString & missionName, QString & teamName, QString key)
       
    76 {
       
    77     QSettings* teamfile = getMissionTeamFile(missionName, teamName);
       
    78     return teamfile->value("Mission " + missionName + "/" + key);
       
    79 }