10 #include "../GrailSystem/Blackboard.hh"
14 using EntityBlackboardPair = std::pair<const class AIEntity*, Blackboard>;
16 template <
typename InstanceType,
typename ContexType = EntityBlackboardPair,
typename DataType =
class AIEntity>
30 std::function<std::vector<ContexType>(
const DataType&)> contextProducer,
31 std::function<std::unique_ptr<InstanceType>(
const ContexType&)> instanceProducer)
32 : name{name}, contextProducer{contextProducer}, instanceProducer{instanceProducer}
44 std::vector<ContexType> ProduceContexts(
const DataType& data)
const
46 return contextProducer(data);
49 std::unique_ptr<InstanceType> ProduceInstance(
const ContexType& context)
const
51 return instanceProducer(context);
54 std::string GetName()
const {
return name; }
57 const std::string name =
"";
59 const std::function<std::vector<ContexType>(
const DataType&)> contextProducer{};
60 const std::function<std::unique_ptr<InstanceType>(
const ContexType&)> instanceProducer{};
The Prefab class - responsible for producing contexts and instances of data used by UtilityReasoner.
Definition: Prefab.hh:21
Prefab(std::string name, std::function< std::vector< ContexType >(const DataType &)> contextProducer, std::function< std::unique_ptr< InstanceType >(const ContexType &)> instanceProducer)
Prefab - Contructor.
Definition: Prefab.hh:29