26 Status Say(BehaviourClient& client,
const std::string& msg);
79 constexpr std::array variable_names = {
80 "SetBlackboardData.key",
81 "SetBlackboardData.data"
86 blackboard.
Set<std::string>(variable_names[0], key);
87 blackboard.
Set<T>(variable_names[1], data);
89 return Internal::SetBlackboardDataImpl<T>(client, key, data);
99 constexpr std::array variable_names = {
100 "SetBlackboardData.key",
101 "SetBlackboardData.data"
107 const std::string& key = blackboard.
Get<std::string>(variable_names[0]);
108 const T& data = blackboard.
Get<T>(variable_names[1]);
110 return Internal::SetBlackboardDataImpl<T>(client, key, data);
130 Status IsHungry(BehaviourClient& client,
const int threshold = 20);
A ManagersClient extended with a blackboard that can store any kind of data and a virtual Yield funct...
Blackboard & GetBlackboard()
A map wrapper to store arbitrary data.
void Set(const std::string &key, const T &value)
Set map entry at key to value.
const T & Get(const std::string &key)
Get the map value at key, casting it to T.
Status SetBlackboardDataImpl(BehaviourClient &client, const std::string &key, const T &data)
Status IsHungryBlackboard(BehaviourClient &client)
Same thing as IsHungry, but reads its parameters from the blackboard.
Status SetBlackboardData(BehaviourClient &client, const std::string &key, const T &data)
Set a value in the blackboard.
Status RemoveBlackboardDataBlackboard(BehaviourClient &client)
Same thing as RemoveBlackboardData, but reads its parameters from the blackboard.
Status SayBlackboard(BehaviourClient &client)
Same thing as Say, but reads its parameters from the blackboard.
Status CopyBlackboardData(BehaviourClient &client, const std::string &src, const std::string &dst)
Copy a blackboard data.
Status IsHungry(BehaviourClient &client, const int threshold=20)
Return success if player food is below a threshold.
Status Disconnect(BehaviourClient &client)
Ask this client to disconnect from the server by setting should_be_closed to true.
Status CopyBlackboardDataBlackboard(BehaviourClient &client)
Same thing as CopyBlackboardData, but reads its parameters from the blackboard.
Status Yield(BehaviourClient &client)
Just call client.Yield().
Status Say(BehaviourClient &client, const std::string &msg)
Send a message in the game chat.
Status CheckBlackboardBoolDataBlackboard(BehaviourClient &client)
Same thing as CheckBlackboardBoolData, but reads its parameters from the blackboard.
Status InteractWithBlock(BehaviourClient &client, const Position &pos, const PlayerDiggingFace face=PlayerDiggingFace::Up, const bool animation=true)
Interact (right click) with the block at the given location.
Direction PlayerDiggingFace
Status IsNightTime(BehaviourClient &client)
Return Success if it's night time (sleep is possible)
Status InteractWithBlockBlackboard(BehaviourClient &client)
Same thing as InteractWithBlock, but reads its parameters from the blackboard.
Status CheckBlackboardBoolData(BehaviourClient &client, const std::string &key)
Check in the blackboard if the bool at key is true.
Status RemoveBlackboardData(BehaviourClient &client, const std::string &key)
Remove a value from the blackboard if exist.
Status IsAlive(BehaviourClient &client)
Return success if player is alive.
Status SetBlackboardDataBlackboard(BehaviourClient &client)
Same thing as SetBlackboardData, but reads its parameters from the blackboard.