Luanti 5.16.0-dev
Loading...
Searching...
No Matches
MockServerActiveObject Class Reference

#include <mock_serveractiveobject.h>

Inheritance diagram for MockServerActiveObject:
Collaboration diagram for MockServerActiveObject:

Public Member Functions

 MockServerActiveObject (ServerEnvironment *env=nullptr, v3f p=v3f())
virtual ActiveObjectType getType () const
virtual bool getCollisionBox (aabb3f *toset) const
virtual bool getSelectionBox (aabb3f *toset) const
virtual bool collideWithObjects () const
virtual std::string getGUID () const
 Returns an unique ID for this object (persistent across unload, server restarts).
Public Member Functions inherited from ServerActiveObject
 ServerActiveObject (ServerEnvironment *env, v3f pos)
virtual ~ServerActiveObject ()=default
virtual ActiveObjectType getSendType () const
virtual void addedToEnvironment (u32 dtime_s)
virtual void removingFromEnvironment ()
void markForRemoval ()
void markForDeactivation ()
v3f getBasePosition () const
void setBasePosition (v3f pos)
ServerEnvironmentgetEnv ()
virtual void setPos (const v3f &pos)
virtual void addPos (const v3f &added_pos)
virtual void moveTo (v3f pos, bool continuous)
virtual float getMinimumSavedMovement ()
virtual std::string getDescription ()
virtual void step (float dtime, bool send_recommended)
virtual std::string getClientInitializationData (u16 protocol_version)
virtual void getStaticData (std::string *result) const
virtual bool isStaticAllowed () const
virtual bool shouldUnload () const
virtual u32 punch (v3f dir, const ToolCapabilities &toolcap, ServerActiveObject *puncher=nullptr, float time_from_last_punch=1000000.0f, u16 initial_wear=0)
virtual void rightClick (ServerActiveObject *clicker)
virtual void setHP (s32 hp, const PlayerHPChangeReason &reason)
virtual u16 getHP () const
virtual void setArmorGroups (const ItemGroupList &armor_groups)
virtual const ItemGroupListgetArmorGroups () const
virtual void setAnimation (v2f frames, float frame_speed, float frame_blend, bool frame_loop)
virtual void getAnimation (v2f *frames, float *frame_speed, float *frame_blend, bool *frame_loop)
virtual void setAnimationSpeed (float frame_speed)
virtual void setBoneOverride (const std::string &bone, const BoneOverride &props)
virtual BoneOverride getBoneOverride (const std::string &bone)
virtual const BoneOverrideMapgetBoneOverrides () const
virtual const std::unordered_set< object_t > & getAttachmentChildIds () const
virtual ServerActiveObjectgetParent () const
virtual ObjectPropertiesaccessObjectProperties ()
virtual void notifyObjectPropertiesModified ()
virtual InventorygetInventory () const
virtual InventoryLocation getInventoryLocation () const
virtual void setInventoryModified ()
virtual std::string getWieldList () const
virtual u16 getWieldIndex () const
virtual ItemStack getWieldedItem (ItemStack *selected, ItemStack *hand=nullptr) const
virtual bool setWieldedItem (const ItemStack &item)
void attachParticleSpawner (u32 id)
void detachParticleSpawner (u32 id)
std::string generateUpdateInfantCommand (u16 infant_id, u16 protocol_version)
void dumpAOMessagesToQueue (std::queue< ActiveObjectMessage > &queue)
bool isGone () const
bool isPendingRemoval () const
void invalidateEffectiveObservers ()
 Invalidate final observer cache.
const ObserversgetEffectiveObservers ()
 Cache m_effective_observers with the names of all observers, also indirect observers (object attachment chain).
const ObserversrecalculateEffectiveObservers ()
 Force a recalculation of final observers (including all parents).
bool isEffectivelyObservedBy (const std::string &player_name)
 Whether the object is sent to player_name.
Public Member Functions inherited from ActiveObject
 ActiveObject (object_t id)
object_t getId () const
void setId (object_t id)
virtual void setAttachment (object_t parent_id, const std::string &bone, v3f position, v3f rotation, bool force_visible)
virtual void getAttachment (object_t *parent_id, std::string *bone, v3f *position, v3f *rotation, bool *force_visible) const
virtual void clearChildAttachments ()
virtual void clearParentAttachment ()
virtual void addAttachmentChild (object_t child_id)
virtual void removeAttachmentChild (object_t child_id)

Private Attributes

std::string m_guid

Additional Inherited Members

Public Types inherited from ServerActiveObject
using Observers = std::optional<std::unordered_set<std::string>>
Public Types inherited from ActiveObject
typedef u16 object_t
Public Attributes inherited from ServerActiveObject
u16 m_known_by_count = 0
bool m_static_exists = false
v3s16 m_static_block = v3s16(1337,1337,1337)
Observers m_observers
Protected Member Functions inherited from ServerActiveObject
virtual void onMarkedForDeactivation ()
virtual void onMarkedForRemoval ()
Protected Attributes inherited from ServerActiveObject
std::optional< Observersm_effective_observers
ServerEnvironmentm_env
std::unordered_set< u32 > m_attached_particle_spawners
bool m_pending_deactivation = false
bool m_pending_removal = false
std::queue< ActiveObjectMessagem_messages_out
Protected Attributes inherited from ActiveObject
object_t m_id

Constructor & Destructor Documentation

◆ MockServerActiveObject()

MockServerActiveObject::MockServerActiveObject ( ServerEnvironment * env = nullptr,
v3f p = v3f() )
inline

References ServerActiveObject::ServerActiveObject(), m_guid, and p().

Here is the call graph for this function:

Member Function Documentation

◆ collideWithObjects()

virtual bool MockServerActiveObject::collideWithObjects ( ) const
inlinevirtual

Implements ActiveObject.

◆ getCollisionBox()

virtual bool MockServerActiveObject::getCollisionBox ( aabb3f * toset) const
inlinevirtual

Returns the collision box of the object. This box is translated by the object's location. The box's coordinates are world coordinates.

Returns
true if the object has a collision box.

Implements ActiveObject.

◆ getGUID()

virtual std::string MockServerActiveObject::getGUID ( ) const
inlinevirtual

Returns an unique ID for this object (persistent across unload, server restarts).

Note
Because these strings are very short, copying them is not expensive.

Implements ServerActiveObject.

References m_guid.

◆ getSelectionBox()

virtual bool MockServerActiveObject::getSelectionBox ( aabb3f * toset) const
inlinevirtual

Returns the selection box of the object. This box is not translated when the object moves. The box's coordinates are world coordinates.

Returns
true if the object has a selection box.

Implements ActiveObject.

◆ getType()

virtual ActiveObjectType MockServerActiveObject::getType ( ) const
inlinevirtual

Implements ActiveObject.

References ACTIVEOBJECT_TYPE_TEST.

Member Data Documentation

◆ m_guid

std::string MockServerActiveObject::m_guid
private

Referenced by MockServerActiveObject(), and getGUID().


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