Botcraft 26.3
Loading...
Searching...
No Matches
GuardianEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
20
25
26
27 std::string GuardianEntity::GetName() const
28 {
29 return "guardian";
30 }
31
36
37
39 {
40 return "guardian";
41 }
42
47
48
50 {
52
53 output["metadata"]["data_id_moving"] = GetDataIdMoving();
54 output["metadata"]["data_id_attack_target"] = GetDataIdAttackTarget();
55
56 return output;
57 }
58
59
61 {
62 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_moving"));
63 }
64
66 {
67 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_attack_target"));
68 }
69
70
71 void GuardianEntity::SetDataIdMoving(const bool data_id_moving)
72 {
73 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_moving"), data_id_moving);
74 }
75
76 void GuardianEntity::SetDataIdAttackTarget(const int data_id_attack_target)
77 {
78 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_attack_target"), data_id_attack_target);
79 }
80
81
83 {
84 return 0.85;
85 }
86
88 {
89 return 0.85;
90 }
91
92}
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::vector< std::any > metadata
Definition Entity.hpp:335
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataIdMoving(const bool data_id_moving)
static std::string GetClassName()
static constexpr int hierarchy_metadata_count
static EntityType GetClassType()
virtual std::string GetName() const override
virtual double GetWidthImpl() const override
void SetDataIdAttackTarget(const int data_id_attack_target)
virtual double GetHeightImpl() const override
virtual EntityType GetType() const override
static constexpr int metadata_count
std::map< EntityAttribute::Type, EntityAttribute > attributes
virtual ProtocolCraft::Json::Value Serialize() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45
#define BOTCRAFT_ENTITY_METADATA_INDEX(name)
Definition Entity.hpp:347