1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwdialogue/dialoguemanager.hpp

68 lines
1.9 KiB
C++
Raw Normal View History

#ifndef GAME_MMDIALOG_DIALOGUEMANAGER_H
#define GAME_MWDIALOG_DIALOGUEMANAGER_H
2010-08-06 16:01:34 +00:00
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>
2010-08-06 16:01:34 +00:00
namespace MWWorld
{
class Environment;
}
namespace MWDialogue
2010-08-06 16:01:34 +00:00
{
class DialogueManager
2010-08-06 16:01:34 +00:00
{
MWWorld::Environment& mEnvironment;
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);
2012-02-15 12:23:59 +00:00
void parseText(std::string text);
std::map<std::string,bool> knownTopics;// Those are the topics the player knows.
std::map<std::string,std::list<ESM::DialInfo>> actorKnownTopics;
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;
2010-08-06 16:01:34 +00:00
public:
DialogueManager (MWWorld::Environment& environment,const Compiler::Extensions& extensions);
2010-08-06 16:01:34 +00:00
void startDialogue (const MWWorld::Ptr& actor);
2010-08-06 16:01:34 +00:00
2012-02-10 15:09:43 +00:00
void addTopic(std::string topic);
void askQuestion(std::string question,int choice);
//calbacks for the GUI
void keywordSelected(std::string keyword);
void goodbyeSelected();
void questionAnswered(std::string answere);
2010-08-06 16:01:34 +00:00
};
}
#endif