OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
filter.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWDIALOGUE_FILTER_H
2 #define GAME_MWDIALOGUE_FILTER_H
3 
4 #include <vector>
5 
6 #include "../mwworld/ptr.hpp"
7 
8 namespace ESM
9 {
10  struct DialInfo;
11  struct Dialogue;
12 }
13 
14 namespace MWDialogue
15 {
16  class SelectWrapper;
17 
18  class Filter
19  {
21  int mChoice;
23 
24  bool testActor (const ESM::DialInfo& info) const;
26 
27  bool testPlayer (const ESM::DialInfo& info) const;
29 
30  bool testSelectStructs (const ESM::DialInfo& info) const;
32 
33  bool testDisposition (const ESM::DialInfo& info, bool invert=false) const;
35 
36  bool testFunctionLocal(const SelectWrapper& select) const;
37 
38  bool testSelectStruct (const SelectWrapper& select) const;
39 
40  bool testSelectStructNumeric (const SelectWrapper& select) const;
41 
42  int getSelectStructInteger (const SelectWrapper& select) const;
43 
44  bool getSelectStructBoolean (const SelectWrapper& select) const;
45 
46  int getFactionRank (const MWWorld::Ptr& actor, const std::string& factionId) const;
47 
48  bool hasFactionRankSkillRequirements (const MWWorld::Ptr& actor, const std::string& factionId,
49  int rank) const;
50 
51  bool hasFactionRankReputationRequirements (const MWWorld::Ptr& actor, const std::string& factionId,
52  int rank) const;
53 
54  public:
55 
56  Filter (const MWWorld::Ptr& actor, int choice, bool talkedToPlayer);
57 
58  std::vector<const ESM::DialInfo *> list (const ESM::Dialogue& dialogue,
59  bool fallbackToInfoRefusal, bool searchAll, bool invertDisposition=false) const;
62 
63  std::vector<const ESM::DialInfo *> listAll (const ESM::Dialogue& dialogue) const;
65 
66  const ESM::DialInfo* search (const ESM::Dialogue& dialogue, const bool fallbackToInfoRefusal) const;
69 
70  bool responseAvailable (const ESM::Dialogue& dialogue) const;
72  };
73 }
74 
75 #endif
int mChoice
Definition: filter.hpp:21
MWWorld::Ptr mActor
Definition: filter.hpp:20
bool testSelectStruct(const SelectWrapper &select) const
Definition: filter.cpp:207
Definition: filter.hpp:18
bool responseAvailable(const ESM::Dialogue &dialogue) const
Does a matching response exist? (disposition is ignored for this check)
Definition: filter.cpp:683
bool testActor(const ESM::DialInfo &info) const
Is this the right actor for this info?
Definition: filter.cpp:24
Definition: loaddial.hpp:21
std::vector< const ESM::DialInfo * > listAll(const ESM::Dialogue &dialogue) const
List all infos that could possibly be used on the given actor, ignoring runtime state filters and ign...
Definition: filter.cpp:627
int getSelectStructInteger(const SelectWrapper &select) const
Definition: filter.cpp:290
Definition: loadinfo.hpp:21
bool testDisposition(const ESM::DialInfo &info, bool invert=false) const
Is the actor disposition toward the player high enough (or low enough, if invert is true)...
Definition: filter.cpp:161
bool hasFactionRankSkillRequirements(const MWWorld::Ptr &actor, const std::string &factionId, int rank) const
Definition: filter.cpp:581
bool testPlayer(const ESM::DialInfo &info) const
Do the player and the cell the player is currently in match info?
Definition: filter.cpp:107
bool testSelectStructs(const ESM::DialInfo &info) const
Are all select structs matching?
Definition: filter.cpp:151
bool testFunctionLocal(const SelectWrapper &select) const
Definition: filter.cpp:174
Filter(const MWWorld::Ptr &actor, int choice, bool talkedToPlayer)
Definition: filter.cpp:613
Definition: selectwrapper.hpp:8
bool hasFactionRankReputationRequirements(const MWWorld::Ptr &actor, const std::string &factionId, int rank) const
Definition: filter.cpp:599
bool getSelectStructBoolean(const SelectWrapper &select) const
Definition: filter.cpp:466
bool testSelectStructNumeric(const SelectWrapper &select) const
Definition: filter.cpp:236
std::vector< const ESM::DialInfo * > list(const ESM::Dialogue &dialogue, bool fallbackToInfoRefusal, bool searchAll, bool invertDisposition=false) const
Definition: filter.cpp:638
const ESM::DialInfo * search(const ESM::Dialogue &dialogue, const bool fallbackToInfoRefusal) const
Definition: filter.cpp:617
bool mTalkedToPlayer
Definition: filter.hpp:22
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
int getFactionRank(const MWWorld::Ptr &actor, const std::string &factionId) const
Definition: filter.cpp:569