2012-08-09 10:05:47 +00:00
|
|
|
#ifndef GAME_MWBASE_DIALOGUEMANAGER_H
|
|
|
|
#define GAME_MWBASE_DIALOGUEMANAGER_H
|
2012-08-09 08:35:53 +00:00
|
|
|
|
|
|
|
#include <string>
|
2017-09-25 19:38:38 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <list>
|
2012-08-09 08:35:53 +00:00
|
|
|
|
2014-03-05 16:08:58 +00:00
|
|
|
#include <stdint.h>
|
2014-02-16 11:54:27 +00:00
|
|
|
|
2014-04-28 09:29:57 +00:00
|
|
|
namespace Loading
|
|
|
|
{
|
|
|
|
class Listener;
|
|
|
|
}
|
|
|
|
|
2014-02-16 11:54:27 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
}
|
|
|
|
|
2012-08-09 08:35:53 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
class Ptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace MWBase
|
|
|
|
{
|
2012-08-09 10:05:47 +00:00
|
|
|
/// \brief Interface for dialogue manager (implemented in MWDialogue)
|
2012-08-09 08:35:53 +00:00
|
|
|
class DialogueManager
|
|
|
|
{
|
|
|
|
DialogueManager (const DialogueManager&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
DialogueManager& operator= (const DialogueManager&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
DialogueManager() {}
|
|
|
|
|
2013-05-15 15:54:18 +00:00
|
|
|
virtual void clear() = 0;
|
|
|
|
|
2012-08-09 08:35:53 +00:00
|
|
|
virtual ~DialogueManager() {}
|
|
|
|
|
2013-03-31 11:13:46 +00:00
|
|
|
virtual bool isInChoice() const = 0;
|
|
|
|
|
2017-09-25 19:38:38 +00:00
|
|
|
typedef std::pair<std::string, std::string> Response; // title, text
|
|
|
|
virtual bool startDialogue (const MWWorld::Ptr& actor, Response& response) = 0;
|
2012-08-09 08:35:53 +00:00
|
|
|
|
|
|
|
virtual void addTopic (const std::string& topic) = 0;
|
|
|
|
|
2017-08-23 04:14:45 +00:00
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
Make it possible to check whether a topic is known by the player from elsewhere
|
|
|
|
in the code
|
|
|
|
*/
|
|
|
|
virtual bool isNewTopic(const std::string& topic) = 0;
|
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
|
|
|
|
2017-09-25 19:38:38 +00:00
|
|
|
virtual void addChoice (const std::string& text,int choice) = 0;
|
|
|
|
virtual const std::vector<std::pair<std::string, int> >& getChoices() = 0;
|
|
|
|
|
|
|
|
virtual bool isGoodbye() = 0;
|
2012-08-09 08:35:53 +00:00
|
|
|
|
|
|
|
virtual void goodbye() = 0;
|
|
|
|
|
2017-04-20 18:55:28 +00:00
|
|
|
virtual void say(const MWWorld::Ptr &actor, const std::string &topic) = 0;
|
2013-07-24 17:02:50 +00:00
|
|
|
|
2017-09-25 19:38:38 +00:00
|
|
|
virtual Response keywordSelected (const std::string& keyword) = 0;
|
2012-08-09 08:35:53 +00:00
|
|
|
virtual void goodbyeSelected() = 0;
|
2017-09-25 19:38:38 +00:00
|
|
|
virtual Response questionAnswered (int answer) = 0;
|
|
|
|
|
|
|
|
virtual std::list<std::string> getAvailableTopics() = 0;
|
2012-11-09 23:29:36 +00:00
|
|
|
|
2017-09-25 19:38:38 +00:00
|
|
|
virtual bool checkServiceRefused (Response& response) = 0;
|
2013-03-16 19:32:21 +00:00
|
|
|
|
2017-09-25 19:38:38 +00:00
|
|
|
virtual Response persuade (int type) = 0;
|
2012-11-09 23:29:36 +00:00
|
|
|
virtual int getTemporaryDispositionChange () const = 0;
|
2014-05-31 11:57:07 +00:00
|
|
|
|
|
|
|
/// @note This change is temporary and gets discarded when dialogue ends.
|
2014-01-08 00:24:06 +00:00
|
|
|
virtual void applyDispositionChange (int delta) = 0;
|
2014-02-16 11:54:27 +00:00
|
|
|
|
|
|
|
virtual int countSavedGameRecords() const = 0;
|
|
|
|
|
2014-04-28 09:29:57 +00:00
|
|
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const = 0;
|
2014-02-16 11:54:27 +00:00
|
|
|
|
2015-01-22 18:04:59 +00:00
|
|
|
virtual void readRecord (ESM::ESMReader& reader, uint32_t type) = 0;
|
2014-05-27 12:54:29 +00:00
|
|
|
|
|
|
|
/// Changes faction1's opinion of faction2 by \a diff.
|
|
|
|
virtual void modFactionReaction (const std::string& faction1, const std::string& faction2, int diff) = 0;
|
|
|
|
|
2015-01-19 22:55:17 +00:00
|
|
|
virtual void setFactionReaction (const std::string& faction1, const std::string& faction2, int absolute) = 0;
|
|
|
|
|
2014-05-27 12:54:29 +00:00
|
|
|
/// @return faction1's opinion of faction2
|
|
|
|
virtual int getFactionReaction (const std::string& faction1, const std::string& faction2) const = 0;
|
2014-06-10 14:36:22 +00:00
|
|
|
|
|
|
|
/// Removes the last added topic response for the given actor from the journal
|
|
|
|
virtual void clearInfoActor (const MWWorld::Ptr& actor) const = 0;
|
2017-05-31 03:51:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
Declare this method here so it can be used from outside of MWDialogue::DialogueManager
|
|
|
|
*/
|
2017-10-07 20:33:36 +00:00
|
|
|
virtual void updateActorKnownTopics() = 0;
|
2017-05-31 03:51:50 +00:00
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
2012-08-09 08:35:53 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|