3 #ifndef GRAIL_ACTION_TEMPLATE_H
4 #define GRAIL_ACTION_TEMPLATE_H
17 using PreconditionFunction = std::function<bool(
const std::vector<const WorldObject*>&,
const WorldState&)>;
18 using EffectFunction = std::function<void(
const std::vector<WorldObject*>&, WorldState&)>;
19 using CostFunction = std::function<double(
const std::vector<const WorldObject*>&,
const WorldState&)>;
27 ActionTemplate(
const std::string& name,
const std::vector<unsigned int>& actionParameterTypes);
37 void SetEffects(EffectFunction effectFunction);
43 void SetTypeId(
int id);
44 int GetTypeId()
const;
45 const std::string& GetName()
const;
46 std::vector<class Action> GenerateActions(
const class WorldState& worldState)
const;
49 std::string name =
"";
50 std::vector<unsigned int> actionParameterTypes{};
51 PreconditionFunction preconditions = [](
const std::vector<const WorldObject*>&,
const WorldState&)
55 EffectFunction effects = [](
const std::vector<WorldObject*>&,
WorldState&)
58 CostFunction cost = [](
const std::vector<const WorldObject*>&,
const WorldState&) {
return 1.0; };
64 #endif // GRAIL_ACTION_TEMPLATE_H