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

65 lines
1.8 KiB
C++
Raw Normal View History

#ifndef GAME_MMDIALOG_DIALOGUEMANAGER_H
#define GAME_MWDIALOG_DIALOGUEMANAGER_H
2010-08-06 18:01:34 +02:00
2010-08-08 13:21:03 +02:00
#include <components/esm/loadinfo.hpp>
2010-08-06 18:01:34 +02:00
2012-02-17 20:20:23 +01:00
#include <components/compiler/errorhandler.hpp>
#include "../mwscript/compilercontext.hpp"
#include "../mwscript/interpretercontext.hpp"
#include <components/compiler/output.hpp>
2010-08-08 13:21:03 +02:00
#include "../mwworld/ptr.hpp"
#include <map>
2010-08-06 18:01:34 +02:00
namespace MWWorld
{
class Environment;
}
namespace MWDialogue
2010-08-06 18:01:34 +02:00
{
2012-02-17 20:20:23 +01:00
class DialogueManager: private Compiler::ErrorHandler
2010-08-06 18:01:34 +02:00
{
MWWorld::Environment& mEnvironment;
2010-08-08 13:21:03 +02:00
bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo::SelectStruct& select) const;
bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo& info) const;
2012-02-15 13:23:59 +01:00
void parseText(std::string text);
std::map<std::string,bool> knownTopics;// Those are the topics the player knows.
2012-02-17 20:20:23 +01:00
std::map<std::string,ESM::DialInfo> actorKnownTopics;
MWScript::CompilerContext mCompilerContext;
/// Report error to the user.
virtual void report (const std::string& message, const Compiler::TokenLoc& loc, Type type){};
/// Report a file related error
virtual void report (const std::string& message, Type type){};
bool compile (const std::string& cmd, Compiler::Output& output);
void executeScript(std::string script);
MWWorld::Ptr mActor;
void printError(std::string error);
2010-08-06 18:01:34 +02:00
public:
DialogueManager (MWWorld::Environment& environment);
2010-08-06 18:01:34 +02:00
void startDialogue (const MWWorld::Ptr& actor);
2010-08-06 18:01:34 +02:00
2012-02-10 16:09:43 +01:00
void addTopic(std::string topic);
//calbacks for the GUI
void keywordSelected(std::string keyword);
void goodbyeSelected();
void questionAnswered(std::string answere);
2010-08-06 18:01:34 +02:00
};
}
#endif