Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::SimpleBehaviourClient Class Reference

A client you can use if you only want to use behaviour trees and don't need to add any custom Handle functions. More...

#include <SimpleBehaviourClient.hpp>

Inheritance diagram for Botcraft::SimpleBehaviourClient:
Botcraft::TemplatedBehaviourClient< SimpleBehaviourClient > Botcraft::BehaviourClient Botcraft::ManagersClient Botcraft::BlackboardObserver Botcraft::ConnectionClient ProtocolCraft::Handler ProtocolCraft::GenericHandler< Message, AllMessages >

Public Member Functions

 SimpleBehaviourClient (const bool use_renderer_)
 
virtual ~SimpleBehaviourClient ()
 
- Public Member Functions inherited from Botcraft::TemplatedBehaviourClient< SimpleBehaviourClient >
 TemplatedBehaviourClient (const bool use_renderer_)
 
virtual ~TemplatedBehaviourClient ()
 
void SetBehaviourTree (const std::shared_ptr< BehaviourTree< SimpleBehaviourClient > > &tree_, const std::map< std::string, std::any > &blackboard_={})
 Save the given tree to replace the current one as soon as possible.
 
virtual void Yield () override
 Can be called to pause the execution of the internal tree function.
 
void StartBehaviour ()
 Start the behaviour thread loop.
 
void RunBehaviourUntilClosed ()
 Blocking call, will return only when the client is disconnected from the server.
 
void BehaviourStep ()
 Perform one step of the behaviour tree.
 
void SyncAction (const int timeout_ms, Args &&... args)
 Set a tree to execute the given action once and block until done.
 
void SyncAction (Args &&... args)
 Set a tree to execute the given action once and block until done.
 
void OnTreeChanged (const BaseNode *root)
 
void OnFullTreeStart ()
 
void OnNodeStartTick ()
 
void OnNodeEndTick (const Status s)
 
void OnNodeTickChild (const size_t i)
 
- Public Member Functions inherited from Botcraft::BehaviourClient
 BehaviourClient (const bool use_renderer_)
 
virtual ~BehaviourClient ()
 
BlackboardGetBlackboard ()
 
void OnReset () override
 
void OnValueChanged (const std::string &key, const std::any &value) override
 
void OnValueRemoved (const std::string &key) override
 
- Public Member Functions inherited from Botcraft::ManagersClient
 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< WorldGetWorld () const
 
std::shared_ptr< EntityManagerGetEntityManager () const
 
std::shared_ptr< LocalPlayerGetLocalPlayer () const
 
std::shared_ptr< InventoryManagerGetInventoryManager () const
 
std::shared_ptr< PhysicsManagerGetPhysicsManager () const
 
std::string GetPlayerName (const ProtocolCraft::UUID &uuid) const
 Get the name of a connected player.
 
int GetDayTime () const
 Get the current tick.
 
- Public Member Functions inherited from Botcraft::ConnectionClient
 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< NetworkManagerGetNetworkManager () 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.
 

Additional Inherited Members

- Protected Member Functions inherited from Botcraft::ManagersClient
virtual void Handle (ProtocolCraft::ClientboundLoginFinishedPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundChangeDifficultyPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundLoginPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundSetHealthPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundPlayerAbilitiesPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundPlayerPositionPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundRespawnPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundSetTimePacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundPlayerInfoRemovePacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundPlayerInfoUpdatePacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundLoginDisconnectPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundDisconnectPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundPlayerPositionPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundDisconnectConfigurationPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundLoginPacket &msg) override
 
virtual void Handle (ProtocolCraft::ClientboundRespawnPacket &msg) override
 
- Protected Attributes inherited from Botcraft::BehaviourClient
Blackboard blackboard
 
- Protected Attributes inherited from Botcraft::ManagersClient
std::shared_ptr< Worldworld
 
std::shared_ptr< EntityManagerentity_manager
 
std::shared_ptr< InventoryManagerinventory_manager
 
std::shared_ptr< PhysicsManagerphysics_manager
 
bool use_renderer
 
std::shared_ptr< Renderer::RenderingManagerrendering_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
 
- Protected Attributes inherited from Botcraft::ConnectionClient
std::shared_ptr< NetworkManagernetwork_manager
 
bool should_be_closed
 

Detailed Description

A client you can use if you only want to use behaviour trees and don't need to add any custom Handle functions.

In case you need to react to packets, just inherit either this class, or BaseBehaviourClient the same way it's done here.

Definition at line 10 of file SimpleBehaviourClient.hpp.

Constructor & Destructor Documentation

◆ SimpleBehaviourClient()

Botcraft::SimpleBehaviourClient::SimpleBehaviourClient ( const bool  use_renderer_)

Definition at line 5 of file SimpleBehaviourClient.cpp.

◆ ~SimpleBehaviourClient()

Botcraft::SimpleBehaviourClient::~SimpleBehaviourClient ( )
virtual

Definition at line 10 of file SimpleBehaviourClient.cpp.


The documentation for this class was generated from the following files: