1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwdialogue/dialoguemanagerimp.hpp

76 lines
2.3 KiB
C++
Raw Normal View History

2012-08-11 10:02:51 +00:00
#ifndef GAME_MWDIALOG_DIALOGUEMANAGERIMP_H
#define GAME_MWDIALOG_DIALOGUEMANAGERIMP_H
2010-08-06 16:01:34 +00:00
#include "../mwbase/dialoguemanager.hpp"
2010-08-08 11:21:03 +00:00
#include <components/esm/loadinfo.hpp>
2010-08-06 16:01:34 +00:00
#include <components/compiler/streamerrorhandler.hpp>
2012-02-17 19:20:23 +00:00
#include "../mwscript/compilercontext.hpp"
#include "../mwscript/interpretercontext.hpp"
#include <components/compiler/output.hpp>
2010-08-08 11:21:03 +00:00
#include "../mwworld/ptr.hpp"
#include <map>
namespace MWDialogue
2010-08-06 16:01:34 +00:00
{
class DialogueManager : public MWBase::DialogueManager
2010-08-06 16:01:34 +00:00
{
2010-08-08 11:21:03 +00:00
bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo::SelectStruct& select) const;
bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo& info) const;
bool functionFilter(const MWWorld::Ptr& actor, const ESM::DialInfo& info,bool choice);
2012-02-15 12:23:59 +00:00
void parseText(std::string text);
void updateTopics();
std::map<std::string,ESM::Dialogue> mDialogueMap;
std::map<std::string,bool> mKnownTopics;// Those are the topics the player knows.
std::list<std::string> mActorKnownTopics;
2012-02-17 19:20:23 +00:00
MWScript::CompilerContext mCompilerContext;
std::ostream mErrorStream;
Compiler::StreamErrorHandler mErrorHandler;
2012-02-17 19:20:23 +00:00
bool compile (const std::string& cmd,std::vector<Interpreter::Type_Code>& code);
2012-02-17 19:20:23 +00:00
void executeScript(std::string script);
MWWorld::Ptr mActor;
void printError(std::string error);
int mChoice;
std::map<std::string,int> mChoiceMap;
std::string mLastTopic;
ESM::DialInfo mLastDialogue;
bool mIsInChoice;
2010-08-06 16:01:34 +00:00
public:
DialogueManager (const Compiler::Extensions& extensions);
2010-08-06 16:01:34 +00:00
virtual void startDialogue (const MWWorld::Ptr& actor);
2010-08-06 16:01:34 +00:00
virtual void addTopic (const std::string& topic);
2012-02-10 15:09:43 +00:00
virtual void askQuestion (const std::string& question,int choice);
virtual void goodbye();
2012-04-04 20:13:57 +00:00
///get the faction of the actor you are talking with
virtual std::string getFaction() const;
2012-04-04 20:13:57 +00:00
//calbacks for the GUI
virtual void keywordSelected (const std::string& keyword);
virtual void goodbyeSelected();
virtual void questionAnswered (const std::string& answer);
2010-08-06 16:01:34 +00:00
};
}
#endif