![]() |
Botcraft 1.21.4
|
A ManagersClient extended with a blackboard that can store any kind of data and a virtual Yield function. More...
#include <BehaviourClient.hpp>
Public Member Functions | |
BehaviourClient (const bool use_renderer_) | |
virtual | ~BehaviourClient () |
virtual void | Yield ()=0 |
Blackboard & | GetBlackboard () |
void | OnReset () override |
void | OnValueChanged (const std::string &key, const std::any &value) override |
void | OnValueRemoved (const std::string &key) override |
![]() | |
ManagersClient (const bool use_renderer_) | |
virtual | ~ManagersClient () |
virtual void | Disconnect () override |
void | SetSharedWorld (const std::shared_ptr< World > world_) |
bool | GetAutoRespawn () const |
void | SetAutoRespawn (const bool b) |
int | SendInventoryTransaction (const std::shared_ptr< ProtocolCraft::ServerboundContainerClickPacket > &transaction) |
std::shared_ptr< World > | GetWorld () const |
std::shared_ptr< EntityManager > | GetEntityManager () const |
std::shared_ptr< LocalPlayer > | GetLocalPlayer () const |
std::shared_ptr< InventoryManager > | GetInventoryManager () const |
std::shared_ptr< PhysicsManager > | GetPhysicsManager () const |
std::string | GetPlayerName (const ProtocolCraft::UUID &uuid) const |
Get the name of a connected player. | |
int | GetDayTime () const |
Get the current tick. | |
![]() | |
ConnectionClient () | |
virtual | ~ConnectionClient () |
void | Connect (const std::string &address, const std::string &login, const bool force_microsoft_account=false) |
Connect the client to the server at address. | |
bool | GetShouldBeClosed () const |
void | SetShouldBeClosed (const bool b) |
std::shared_ptr< NetworkManager > | GetNetworkManager () const |
void | SendChatMessage (const std::string &msg) |
Send a message in the game chat. | |
void | SendChatCommand (const std::string &command) |
Send a command in the game chat. | |
void | Respawn () |
Ask to respawn when dead. | |
Protected Attributes | |
Blackboard | blackboard |
![]() | |
std::shared_ptr< World > | world |
std::shared_ptr< EntityManager > | entity_manager |
std::shared_ptr< InventoryManager > | inventory_manager |
std::shared_ptr< PhysicsManager > | physics_manager |
bool | use_renderer |
std::shared_ptr< Renderer::RenderingManager > | rendering_manager |
bool | auto_respawn |
Difficulty | difficulty |
bool | difficulty_locked |
bool | is_hardcore |
std::atomic< int > | day_time |
std::map< ProtocolCraft::UUID, std::string > | player_names |
Names of all connected players. | |
std::shared_mutex | player_names_mutex |
![]() | |
std::shared_ptr< NetworkManager > | network_manager |
bool | should_be_closed |
A ManagersClient extended with a blackboard that can store any kind of data and a virtual Yield function.
You should not inherit from this class, but from TemplatedBehaviourClient or SimpleBehaviourClient instead.
Definition at line 12 of file BehaviourClient.hpp.
Botcraft::BehaviourClient::BehaviourClient | ( | const bool | use_renderer_ | ) |
Definition at line 8 of file BehaviourClient.cpp.
References blackboard, and Botcraft::Blackboard::Subscribe().
|
virtual |
Definition at line 14 of file BehaviourClient.cpp.
References blackboard, and Botcraft::Blackboard::Unsubscribe().
Blackboard & Botcraft::BehaviourClient::GetBlackboard | ( | ) |
Definition at line 19 of file BehaviourClient.cpp.
References blackboard.
Referenced by Botcraft::CheckBlackboardBoolData(), Botcraft::CheckBlackboardBoolDataBlackboard(), Botcraft::CheckBlackboardBoolDataImpl(), Botcraft::ClickSlotInContainer(), Botcraft::ClickSlotInContainerBlackboard(), Botcraft::CloseContainer(), Botcraft::CloseContainerBlackboard(), Botcraft::CopyBlackboardData(), Botcraft::CopyBlackboardDataBlackboard(), Botcraft::CopyBlackboardDataImpl(), Botcraft::Craft(), Botcraft::CraftBlackboard(), Botcraft::CraftNamed(), Botcraft::CraftNamedBlackboard(), Botcraft::Dig(), Botcraft::DigBlackboard(), Botcraft::DropItemsFromContainer(), Botcraft::DropItemsFromContainerBlackboard(), Botcraft::Eat(), Botcraft::EatBlackboard(), Botcraft::GoTo(), Botcraft::GoToBlackboard(), Botcraft::GoToDouble(), Botcraft::GoToDoubleBlackboard(), Botcraft::HasItemIdInInventory(), Botcraft::HasItemIdInInventoryBlackboard(), Botcraft::HasItemInInventory(), Botcraft::HasItemInInventoryBlackboard(), Botcraft::InteractEntity(), Botcraft::InteractEntityBlackboard(), Botcraft::InteractWithBlock(), Botcraft::InteractWithBlockBlackboard(), Botcraft::IsHungry(), Botcraft::IsHungryBlackboard(), Botcraft::LogInventoryContent(), Botcraft::LogInventoryContentBlackboard(), Botcraft::LookAt(), Botcraft::LookAtBlackboard(), Botcraft::OpenContainer(), Botcraft::OpenContainerBlackboard(), Botcraft::PlaceBlock(), Botcraft::PlaceBlockBlackboard(), Botcraft::PutOneItemInContainerSlot(), Botcraft::PutOneItemInContainerSlotBlackboard(), Botcraft::RemoveBlackboardData(), Botcraft::RemoveBlackboardDataBlackboard(), Botcraft::RemoveBlackboardDataImpl(), Botcraft::Say(), Botcraft::SayBlackboard(), Botcraft::SetBlackboardData(), Botcraft::SetBlackboardDataBlackboard(), Botcraft::Internal::SetBlackboardDataImpl(), Botcraft::SetItemIdInHand(), Botcraft::SetItemIdInHandBlackboard(), Botcraft::SetItemInHand(), Botcraft::SetItemInHandBlackboard(), Botcraft::SwapItemsInContainer(), Botcraft::SwapItemsInContainerBlackboard(), Botcraft::Trade(), Botcraft::TradeBlackboard(), Botcraft::TradeName(), and Botcraft::TradeNameBlackboard().
|
overridevirtual |
Implements Botcraft::BlackboardObserver.
Definition at line 24 of file BehaviourClient.cpp.
References Botcraft::ManagersClient::rendering_manager.
|
overridevirtual |
Implements Botcraft::BlackboardObserver.
Definition at line 34 of file BehaviourClient.cpp.
References Botcraft::ManagersClient::rendering_manager.
|
overridevirtual |
Implements Botcraft::BlackboardObserver.
Definition at line 44 of file BehaviourClient.cpp.
References Botcraft::ManagersClient::rendering_manager.
|
pure virtual |
Implemented in Botcraft::TemplatedBehaviourClient< TDerived >, and Botcraft::TemplatedBehaviourClient< SimpleBehaviourClient >.
Referenced by Botcraft::ClickSlotInContainerImpl(), Botcraft::CraftImpl(), Botcraft::DigImpl(), Botcraft::EatImpl(), Botcraft::GoToImpl(), Botcraft::OpenContainerImpl(), Botcraft::PlaceBlockImpl(), Botcraft::TradeImpl(), Botcraft::Yield(), and Botcraft::Utilities::YieldForCondition().
|
protected |
Definition at line 28 of file BehaviourClient.hpp.
Referenced by BehaviourClient(), GetBlackboard(), Botcraft::TemplatedBehaviourClient< TDerived >::TreeLoop(), and ~BehaviourClient().