Logo Search packages:      
Sourcecode: kalcul version File versions  Download package

void KalculView::setLevel ( const QString &  level  )  [slot]

Method for setting the level to play.

Parameters:
level The contents of the level file

Definition at line 82 of file kalculview.cpp.

References levelNumberOfQuestions, levelQuestionsList, mode, and reset().

{
    mode = Level;
    levelQuestionsList.clear();

    int tmpCurrent = 0;
    int tmpPosition;
    QStringList tmpList = QStringList::split("\n", level);
    for (QStringList::Iterator it = tmpList.begin(); it != tmpList.end();
         ++it, ++tmpCurrent) {
        tmpPosition = (*it).find("=");
        levelQuestionsList.append((*it).left(tmpPosition));
        correctAnswer[tmpCurrent] = (*it).mid(tmpPosition + 2).toInt();
    }
    levelNumberOfQuestions = tmpCurrent;
    
    reset();
}


Generated by  Doxygen 1.6.0   Back to index