(C++)  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Consideration.hh
1 #ifndef GRAIL_CONSIDERATION_H
2 #define GRAIL_CONSIDERATION_H
3 
4 #include "../GrailSystem/AIEntity.hh"
5 #include "../GrailSystem/Blackboard.hh"
6 
7 
8 namespace grail
9 {
10  namespace utility
11  {
12  template <typename T>
17  {
18  public:
23  Consideration(int initRank)
24  : rank(initRank)
25  {
26  }
27 
32  {
33  }
34 
35  Consideration(const Consideration<T>&) = default;
36  Consideration(Consideration<T>&&) = default;
37 
38  virtual ~Consideration() = default;
39 
40  Consideration& operator = (const Consideration<T>&) = default;
41  Consideration& operator = (Consideration<T>&&) = default;
42 
47  virtual float Evaluate(const T&) const = 0;
48 
53  const int GetRank() const { return rank; }
54 
55  virtual std::string GetDisplayName() const { return "unnamed_consideration"; }
56 
57  protected:
58  int rank = 0;
59  };
60 
61  using DefaultConsideration = Consideration<const AIEntity*>;
62  using EntityBlackboardPair = std::pair<const AIEntity*, Blackboard>;
63  using UtilityConsideration = Consideration<EntityBlackboardPair>;
64  }
65 }
66 #endif //GRAIL_CONSIDERATION_H
The Consideration class - Representation of subset of game state.
Definition: Consideration.hh:17
Consideration()
Consideration - Constructs consideration with default rank of 0.
Definition: Consideration.hh:31
Consideration(int initRank)
Consideration - Constructs consideration with provided rank.
Definition: Consideration.hh:23
const int GetRank() const
GetRank.
Definition: Consideration.hh:53
virtual float Evaluate(const T &) const =0
Evaluate - Reduces consideration to a floating-point number form.