summaryrefslogtreecommitdiff
path: root/src/server/unit_sao.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2020-04-11 09:35:27 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-04-11 16:07:17 +0200
commitc99e8df07fe88c0b19363beca09e12f151bc13d0 (patch)
tree6e601c3319bdadc0e6bdd1651c26cb48fe1aeb82 /src/server/unit_sao.h
parent2a7267febfd5f827c8a2654cc67e5db07f59cbac (diff)
downloadminetest-c99e8df07fe88c0b19363beca09e12f151bc13d0.tar.gz
minetest-c99e8df07fe88c0b19363beca09e12f151bc13d0.tar.bz2
minetest-c99e8df07fe88c0b19363beca09e12f151bc13d0.zip
pass clang-format
Diffstat (limited to 'src/server/unit_sao.h')
-rw-r--r--src/server/unit_sao.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/server/unit_sao.h b/src/server/unit_sao.h
index d0e20fb77..c73115855 100644
--- a/src/server/unit_sao.h
+++ b/src/server/unit_sao.h
@@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "object_properties.h"
#include "serveractiveobject.h"
-class UnitSAO: public ServerActiveObject
+class UnitSAO : public ServerActiveObject
{
public:
UnitSAO(ServerEnvironment *env, v3f pos);
@@ -40,20 +40,24 @@ public:
// Use a function, if isDead can be defined by other conditions
bool isDead() const { return m_hp == 0; }
- inline bool isAttached() const
- { return getParent(); }
+ inline bool isAttached() const { return getParent(); }
inline bool isImmortal() const
- { return itemgroup_get(getArmorGroups(), "immortal"); }
+ {
+ return itemgroup_get(getArmorGroups(), "immortal");
+ }
void setArmorGroups(const ItemGroupList &armor_groups);
const ItemGroupList &getArmorGroups() const;
- void setAnimation(v2f frame_range, float frame_speed, float frame_blend, bool frame_loop);
- void getAnimation(v2f *frame_range, float *frame_speed, float *frame_blend, bool *frame_loop);
+ void setAnimation(v2f frame_range, float frame_speed, float frame_blend,
+ bool frame_loop);
+ void getAnimation(v2f *frame_range, float *frame_speed, float *frame_blend,
+ bool *frame_loop);
void setAnimationSpeed(float frame_speed);
void setBonePosition(const std::string &bone, v3f position, v3f rotation);
void getBonePosition(const std::string &bone, v3f *position, v3f *rotation);
- void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation);
+ void setAttachment(int parent_id, const std::string &bone, v3f position,
+ v3f rotation);
void getAttachment(int *parent_id, std::string *bone, v3f *position,
v3f *rotation) const;
void clearChildAttachments();
@@ -62,20 +66,20 @@ public:
void removeAttachmentChild(int child_id);
const std::unordered_set<int> &getAttachmentChildIds() const;
ServerActiveObject *getParent() const;
- ObjectProperties* accessObjectProperties();
+ ObjectProperties *accessObjectProperties();
void notifyObjectPropertiesModified();
std::string generateUpdateAttachmentCommand() const;
std::string generateUpdateAnimationSpeedCommand() const;
std::string generateUpdateAnimationCommand() const;
std::string generateUpdateArmorGroupsCommand() const;
- static std::string generateUpdatePositionCommand(const v3f &position, const v3f &velocity,
- const v3f &acceleration, const v3f &rotation, bool do_interpolate,
- bool is_movement_end, f32 update_interval);
+ static std::string generateUpdatePositionCommand(const v3f &position,
+ const v3f &velocity, const v3f &acceleration, const v3f &rotation,
+ bool do_interpolate, bool is_movement_end, f32 update_interval);
std::string generateSetPropertiesCommand(const ObjectProperties &prop) const;
void sendPunchCommand();
static std::string generateUpdateBonePositionCommand(const std::string &bone,
- const v3f &position, const v3f &rotation);
+ const v3f &position, const v3f &rotation);
protected:
u16 m_hp = 1;
@@ -105,6 +109,7 @@ protected:
v3f m_attachment_position;
v3f m_attachment_rotation;
bool m_attachment_sent = false;
+
private:
void onAttach(int parent_id);
void onDetach(int parent_id);