|
Last change
on this file since 11750 was
11644,
checked in by kuchlert, 8 years ago
|
|
eigentlich fertig nur noch altes system entfernen
|
|
File size:
1.3 KB
|
| Rev | Line | |
|---|
| [11607] | 1 | #include "DialogManager.h" |
|---|
| 2 | #include "core/CoreIncludes.h" |
|---|
| 3 | #include "core/singleton/ScopedSingletonIncludes.h" |
|---|
| [11612] | 4 | #include <string> |
|---|
| [11607] | 5 | |
|---|
| [11612] | 6 | namespace 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 | { |
|---|
| [11644] | 31 | return this->answerIds_->size(); |
|---|
| [11642] | 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 | |
|---|
| [11644] | 44 | bool DialogManager::endtest(int index) |
|---|
| 45 | { |
|---|
| 46 | if(this->answerIds_->empty()) |
|---|
| 47 | { |
|---|
| 48 | return true; |
|---|
| 49 | } |
|---|
| 50 | else |
|---|
| 51 | { |
|---|
| 52 | return this->currentTalk_->ending(this->answerIds_->at(index)); |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| [11642] | 55 | } |
|---|
| 56 | |
|---|
| 57 | void DialogManager::update(int index) |
|---|
| 58 | { |
|---|
| 59 | this->currentTalk_->update(answerIds_->at(index)); |
|---|
| 60 | answerIds_ = this->currentTalk_->getAnswerIds(); |
|---|
| 61 | } |
|---|
| [11607] | 62 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.