From e6ede480c74a1f4a0d34c92b2a634a610d33fd1a Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 9 Aug 2012 09:41:17 +0200 Subject: [PATCH] Issue #107: fixed up some interfaces --- apps/openmw/mwdialogue/dialoguemanager.cpp | 18 +++++++++--------- apps/openmw/mwdialogue/dialoguemanager.hpp | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp index 3fde7ad6c..7c23ecebb 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.cpp +++ b/apps/openmw/mwdialogue/dialoguemanager.cpp @@ -599,12 +599,12 @@ namespace MWDialogue } } - void DialogueManager::addTopic(std::string topic) + void DialogueManager::addTopic (const std::string& topic) { mKnownTopics[toLower(topic)] = true; } - void DialogueManager::parseText(std::string text) + void DialogueManager::parseText (std::string text) { std::list::iterator it; for(it = mActorKnownTopics.begin();it != mActorKnownTopics.end();++it) @@ -804,7 +804,7 @@ namespace MWDialogue mChoice = choice; } - void DialogueManager::keywordSelected(std::string keyword) + void DialogueManager::keywordSelected (const std::string& keyword) { if(!mIsInChoice) { @@ -846,11 +846,11 @@ namespace MWDialogue MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); } - void DialogueManager::questionAnswered(std::string answere) + void DialogueManager::questionAnswered (const std::string& answer) { - if(mChoiceMap.find(answere) != mChoiceMap.end()) + if(mChoiceMap.find(answer) != mChoiceMap.end()) { - mChoice = mChoiceMap[answere]; + mChoice = mChoiceMap[answer]; std::vector::const_iterator iter; if(mDialogueMap.find(mLastTopic) != mDialogueMap.end()) @@ -882,13 +882,13 @@ namespace MWDialogue } } - void DialogueManager::printError(std::string error) + void DialogueManager::printError (std::string error) { MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); win->addText(error); } - void DialogueManager::askQuestion(std::string question, int choice) + void DialogueManager::askQuestion (const std::string& question, int choice) { MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); win->askQuestion(question); @@ -896,7 +896,7 @@ namespace MWDialogue mIsInChoice = true; } - std::string DialogueManager::getFaction() + std::string DialogueManager::getFaction() const { if (mActor.getTypeName() != typeid(ESM::NPC).name()) return ""; diff --git a/apps/openmw/mwdialogue/dialoguemanager.hpp b/apps/openmw/mwdialogue/dialoguemanager.hpp index d139ddc01..f28b5647c 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.hpp +++ b/apps/openmw/mwdialogue/dialoguemanager.hpp @@ -52,19 +52,19 @@ namespace MWDialogue void startDialogue (const MWWorld::Ptr& actor); - void addTopic(std::string topic); + void addTopic (const std::string& topic); - void askQuestion(std::string question,int choice); + void askQuestion (const std::string& question,int choice); void goodbye(); ///get the faction of the actor you are talking with - std::string getFaction(); + std::string getFaction() const; //calbacks for the GUI - void keywordSelected(std::string keyword); + void keywordSelected (const std::string& keyword); void goodbyeSelected(); - void questionAnswered(std::string answere); + void questionAnswered (const std::string& answer); }; }