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, 6 years ago

erste version bei der listenauswahl funktioniert

File size: 1.2 KB
Line 
1#include "DialogManager.h"
2#include "core/CoreIncludes.h"
3#include "core/singleton/ScopedSingletonIncludes.h"
4#include <string>
5
6namespace orxonox {
7        ManageScopedSingleton(DialogManager, ScopeID::ROOT, false);
8       
9
10       
11        DialogManager::DialogManager()
12        {
13                this->currentTalk_ = nullptr;
14        }
15
16        void DialogManager::setDialog(Dialog* dialog)
17        {
18                this->currentTalk_ = dialog;
19                answerIds_ = currentTalk_->getAnswerIds();     
20        }
21
22        //from here onward funcionality for lua axports
23
24    std::string DialogManager::getQuestion()
25    {
26        return this->currentTalk_->getQuestionString();
27    }
28
29    int DialogManager::getSize()
30    {   
31        return 2; //return this->answerIds_->size();
32    }
33
34    std::string DialogManager::getAnswer(int index)
35    {
36        return this->currentTalk_->getAnswerString(this->answerIds_->at(index));
37    }
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    }
54}
Note: See TracBrowser for help on using the repository browser.