本文整理汇总了C++中Quest::id方法的典型用法代码示例。如果您正苦于以下问题:C++ Quest::id方法的具体用法?C++ Quest::id怎么用?C++ Quest::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quest
的用法示例。
在下文中一共展示了Quest::id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processQuest
/**
* @brief OknoTawerny::przyjmij Zależnie od zaznaczenia przyjmuje oferowane zadanie albo odrzuca jedno z podjętych
*/
void TavernWindow::processQuest()
{
if (acceptQuestButton->text() == acceptText) { //NOTE do I really want string comparision? Maybe boolean flag?
int index = availableQuestsWidget->currentRow();
player_->quests()->push_back(new Quest(availableQuests_->at(index)));
player_->quest(player_->quests()->size() - 1)->setEmployerField(player_->position());
availableQuests_->removeAt(index);
} else {
Quest *quest = player_->quest(currentQuestsWidget->currentRow());
player_->removeQuest(quest->id());
questRejected = true;
player_->setGold(qMax(0, player_->gold() - QuestDeclineCost));
playerWindow_->displayPlayer(player_);
}
fillQuestListWidgets();
acceptQuestButton->setEnabled(false);
showDestinationButton->setEnabled(false);
}
示例2: displayAvailableQuest
/**
* @brief OknoTawerny::wyswietlOpisDlaMozliwych Wyświetla opis dla zadania oferowanego.
* @param element dane zaznaczonego elementu
*/
void TavernWindow::displayAvailableQuest(const QModelIndex &index)
{
currentQuestsWidget->setCurrentRow(-1);
Quest *quest = availableQuests_->at(index.row());
lastDisplayedQuest = quest;
showDestinationButton->setEnabled(true);
bool playerHasMaxQuests = player_->quests()->size() == MaximumNumberOfQuestsTaken;
bool alreadyTaken;
for (Quest *q : *player_->quests())
if (quest->id() == q->id())
alreadyTaken = true;
acceptQuestButton->setEnabled(!playerHasMaxQuests && !alreadyTaken);
acceptQuestButton->setText(acceptText);
generateDescription(quest, questDescriptionWidget);
}