1 #ifndef GRAIL_ACTION_TEMPLATE_H
2 #define GRAIL_ACTION_TEMPLATE_H
15 using PreconditionFunction = std::function<bool(
const std::vector<const WorldObject*>&,
const WorldState&)>;
16 using EffectFunction = std::function<void(
const std::vector<WorldObject*>&, WorldState&)>;
17 using CostFunction = std::function<double(
const std::vector<const WorldObject*>&,
const WorldState&)>;
25 ActionTemplate(
const std::string& name,
const std::vector<unsigned int>& actionParameterTypes);
35 void SetEffects(EffectFunction effectFunction);
41 void SetTypeId(
int id);
42 int GetTypeId()
const;
43 const std::string& GetName()
const;
44 std::vector<class Action> GenerateActions(
const class WorldState& worldState)
const;
47 std::string name =
"";
48 std::vector<unsigned int> actionParameterTypes{};
49 PreconditionFunction preconditions = [](
const std::vector<const WorldObject*>&,
const WorldState&)
53 EffectFunction effects = [](
const std::vector<WorldObject*>&,
WorldState&)
56 CostFunction cost = [](
const std::vector<const WorldObject*>&,
const WorldState&) {
return 1.0; };
61 #endif // GRAIL_ACTION_TEMPLATE_H