diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:44:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:44:42 +0100 |
commit | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (patch) | |
tree | c980d614fec4a5495798be3e79e033229062c3cd /src/client/clientobject.h | |
parent | 28f6a79706b088c37268a59d90878220dc4ef9c7 (diff) | |
parent | 3af10766fd2b58b068e970266724d7eb10e9316b (diff) | |
download | dragonfireclient-5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/client/clientobject.h')
-rw-r--r-- | src/client/clientobject.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/client/clientobject.h b/src/client/clientobject.h index ecd8059ef..7b451eb36 100644 --- a/src/client/clientobject.h +++ b/src/client/clientobject.h @@ -21,10 +21,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irrlichttypes_extrabloated.h" #include "activeobject.h" +#include <ISceneNode.h> +#include <IMeshSceneNode.h> #include <unordered_map> #include <unordered_set> + class ClientEnvironment; class ITextureSource; class Client; @@ -48,16 +51,20 @@ public: virtual bool getSelectionBox(aabb3f *toset) const { return false; } virtual bool collideWithObjects() const { return false; } virtual const v3f getPosition() const { return v3f(0.0f); } - virtual scene::ISceneNode *getSceneNode() const - { return NULL; } + virtual scene::ISceneNode *getSceneNode() const { return NULL; } virtual scene::IAnimatedMeshSceneNode *getAnimatedMeshSceneNode() const - { return NULL; } + { + return NULL; + } virtual bool isLocalPlayer() const { return false; } virtual ClientActiveObject *getParent() const { return nullptr; }; virtual const std::unordered_set<int> &getAttachmentChildIds() const - { static std::unordered_set<int> rv; return rv; } - virtual void updateAttachments() {}; + { + static std::unordered_set<int> rv; + return rv; + } + virtual void updateAttachments(){}; virtual bool doShowSelectionBox() { return true; } @@ -77,12 +84,15 @@ public: virtual void initialize(const std::string &data) {} // Create a certain type of ClientActiveObject - static ClientActiveObject *create(ActiveObjectType type, Client *client, - ClientEnvironment *env); + static ClientActiveObject *create( + ActiveObjectType type, Client *client, ClientEnvironment *env); // If returns true, punch will not be sent to the server virtual bool directReportPunch(v3f dir, const ItemStack *punchitem = nullptr, - float time_from_last_punch = 1000000) { return false; } + float time_from_last_punch = 1000000) + { + return false; + } protected: // Used for creating objects based on type @@ -90,6 +100,7 @@ protected: static void registerType(u16 type, Factory f); Client *m_client; ClientEnvironment *m_env; + private: // Used for creating objects based on type static std::unordered_map<u16, Factory> m_types; @@ -106,7 +117,7 @@ public: d = a_d; } - bool operator < (const DistanceSortedActiveObject &other) const + bool operator<(const DistanceSortedActiveObject &other) const { return d < other.d; } |