Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Dialog_HS17/src/modules/dialog/DialogManager.cc @ 11642

Last change on this file since 11642 was 11642, checked in by kuchlert, 8 years ago

erste version bei der listenauswahl funktioniert

File size: 1.2 KB
RevLine 
[11607]1#include "DialogManager.h"
2#include "core/CoreIncludes.h"
3#include "core/singleton/ScopedSingletonIncludes.h"
[11612]4#include <string>
[11607]5
[11612]6namespace orxonox {
7        ManageScopedSingleton(DialogManager, ScopeID::ROOT, false);
8       
[11607]9
[11612]10       
11        DialogManager::DialogManager()
12        {
13                this->currentTalk_ = nullptr;
14        }
[11607]15
[11612]16        void DialogManager::setDialog(Dialog* dialog)
[11607]17        {
[11642]18                this->currentTalk_ = dialog;
19                answerIds_ = currentTalk_->getAnswerIds();     
[11607]20        }
21
[11612]22        //from here onward funcionality for lua axports
23
24    std::string DialogManager::getQuestion()
25    {
26        return this->currentTalk_->getQuestionString();
27    }
28
[11642]29    int DialogManager::getSize()
30    {   
31        return 2; //return this->answerIds_->size();
32    }
33
34    std::string DialogManager::getAnswer(int index)
[11612]35    {
[11642]36        return this->currentTalk_->getAnswerString(this->answerIds_->at(index));
[11612]37    }
[11642]38       
39    std::string DialogManager::getPerson()
40    {
41        return this->currentTalk_->getName();
42    }
43
44    bool DialogManager::endtest()
45    {
46        return this->currentTalk_->ending();
47    }
48
49    void DialogManager::update(int index)
50    {
51        this->currentTalk_->update(answerIds_->at(index));
52        answerIds_ = this->currentTalk_->getAnswerIds();
53    }
[11607]54}
Note: See TracBrowser for help on using the repository browser.