mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 12:42:11 +00:00
14daadded7
To fix warnings: /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:588:8: warning: delete called on non-final 'NifOsg::ControllerFunction' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] delete __p; ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:595:4: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<NifOsg::ControllerFunction *>' requested here : __shared_count(__p) ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr_base.h:1079:17: note: in instantiation of function template specialization 'std::__shared_count<__gnu_cxx::_S_atomic>::__shared_count<NifOsg::ControllerFunction *>' requested here : _M_ptr(__p), _M_refcount(__p, typename is_array<_Tp>::type()) ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/shared_ptr.h:129:25: note: in instantiation of function template specialization 'std::__shared_ptr<NifOsg::ControllerFunction, __gnu_cxx::_S_atomic>::__shared_ptr<NifOsg::ControllerFunction, void>' requested here shared_ptr(_Yp* __p) : __shared_ptr<_Tp>(__p) { } ^ /home/elsid/dev/openmw/components/nifosg/nifloader.cpp:242:39: note: in instantiation of function template specialization 'std::shared_ptr<NifOsg::ControllerFunction>::shared_ptr<NifOsg::ControllerFunction, void>' requested here callback->setFunction(std::shared_ptr<NifOsg::ControllerFunction>(new NifOsg::ControllerFunction(key))); ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:78:2: warning: delete called on non-final 'MWGui::ResponseCallback' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] delete __ptr; ^ /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/7.3.1/../../../../include/c++/7.3.1/bits/unique_ptr.h:268:4: note: in instantiation of member function 'std::default_delete<MWGui::ResponseCallback>::operator()' requested here get_deleter()(__ptr); ^ /home/elsid/dev/openmw/apps/openmw/mwgui/dialogue.cpp:58:23: note: in instantiation of member function 'std::unique_ptr<MWGui::ResponseCallback, std::default_delete<MWGui::ResponseCallback> >::~unique_ptr' requested here PersuasionDialog::PersuasionDialog(ResponseCallback* callback) ^
101 lines
3.0 KiB
C++
101 lines
3.0 KiB
C++
#ifndef GAME_MWBASE_DIALOGUEMANAGER_H
|
|
#define GAME_MWBASE_DIALOGUEMANAGER_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <list>
|
|
|
|
#include <stdint.h>
|
|
|
|
namespace Loading
|
|
{
|
|
class Listener;
|
|
}
|
|
|
|
namespace ESM
|
|
{
|
|
class ESMReader;
|
|
class ESMWriter;
|
|
}
|
|
|
|
namespace MWWorld
|
|
{
|
|
class Ptr;
|
|
}
|
|
|
|
namespace MWBase
|
|
{
|
|
/// \brief Interface for dialogue manager (implemented in MWDialogue)
|
|
class DialogueManager
|
|
{
|
|
DialogueManager (const DialogueManager&);
|
|
///< not implemented
|
|
|
|
DialogueManager& operator= (const DialogueManager&);
|
|
///< not implemented
|
|
|
|
public:
|
|
|
|
class ResponseCallback
|
|
{
|
|
public:
|
|
virtual ~ResponseCallback() = default;
|
|
virtual void addResponse(const std::string& title, const std::string& text) = 0;
|
|
};
|
|
|
|
DialogueManager() {}
|
|
|
|
virtual void clear() = 0;
|
|
|
|
virtual ~DialogueManager() {}
|
|
|
|
virtual bool isInChoice() const = 0;
|
|
|
|
virtual bool startDialogue (const MWWorld::Ptr& actor, ResponseCallback* callback) = 0;
|
|
|
|
virtual void addTopic (const std::string& topic) = 0;
|
|
|
|
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;
|
|
|
|
virtual void goodbye() = 0;
|
|
|
|
virtual void say(const MWWorld::Ptr &actor, const std::string &topic) = 0;
|
|
|
|
virtual void keywordSelected (const std::string& keyword, ResponseCallback* callback) = 0;
|
|
virtual void goodbyeSelected() = 0;
|
|
virtual void questionAnswered (int answer, ResponseCallback* callback) = 0;
|
|
|
|
virtual std::list<std::string> getAvailableTopics() = 0;
|
|
|
|
virtual bool checkServiceRefused (ResponseCallback* callback) = 0;
|
|
|
|
virtual void persuade (int type, ResponseCallback* callback) = 0;
|
|
virtual int getTemporaryDispositionChange () const = 0;
|
|
|
|
/// @note This change is temporary and gets discarded when dialogue ends.
|
|
virtual void applyDispositionChange (int delta) = 0;
|
|
|
|
virtual int countSavedGameRecords() const = 0;
|
|
|
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const = 0;
|
|
|
|
virtual void readRecord (ESM::ESMReader& reader, uint32_t type) = 0;
|
|
|
|
/// Changes faction1's opinion of faction2 by \a diff.
|
|
virtual void modFactionReaction (const std::string& faction1, const std::string& faction2, int diff) = 0;
|
|
|
|
virtual void setFactionReaction (const std::string& faction1, const std::string& faction2, int absolute) = 0;
|
|
|
|
/// @return faction1's opinion of faction2
|
|
virtual int getFactionReaction (const std::string& faction1, const std::string& faction2) const = 0;
|
|
|
|
/// Removes the last added topic response for the given actor from the journal
|
|
virtual void clearInfoActor (const MWWorld::Ptr& actor) const = 0;
|
|
};
|
|
}
|
|
|
|
#endif
|