From 7074f35e4ba831e358117842b99ee35b87f85ae5 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 15:58:20 +0700 Subject: shared_ptr -> std::shared_ptr This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today. --- Minecraft.World/SynchedEntityData.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Minecraft.World/SynchedEntityData.h') diff --git a/Minecraft.World/SynchedEntityData.h b/Minecraft.World/SynchedEntityData.h index e79a10b8..05a6fef2 100644 --- a/Minecraft.World/SynchedEntityData.h +++ b/Minecraft.World/SynchedEntityData.h @@ -19,7 +19,7 @@ public: int value_int; short value_short; wstring value_wstring; - shared_ptr value_itemInstance; + std::shared_ptr value_itemInstance; bool dirty; public: @@ -27,7 +27,7 @@ public: DataItem(int type, int id, byte value); DataItem(int type, int id, int value); DataItem(int type, int id, const wstring& value); - DataItem(int type, int id, shared_ptr itemInstance); + DataItem(int type, int id, std::shared_ptr itemInstance); DataItem(int type, int id, short value); int getId(); @@ -35,12 +35,12 @@ public: void setValue(int value); void setValue(short value); void setValue(const wstring& value); - void setValue(shared_ptr value); + void setValue(std::shared_ptr value); byte getValue_byte(); int getValue_int(); short getValue_short(); wstring getValue_wstring(); - shared_ptr getValue_itemInstance(); + std::shared_ptr getValue_itemInstance(); int getType(); bool isDirty(); void setDirty(bool dirty); @@ -71,7 +71,7 @@ private: // the id value must fit in the remaining bits static const int MAX_ID_VALUE = ~TYPE_MASK & 0xff; - unordered_map > itemsById; + unordered_map > itemsById; bool m_isDirty; public: @@ -91,35 +91,35 @@ public: int getInteger(int id); float getFloat(int id); wstring getString(int id); - shared_ptr getItemInstance(int id); + std::shared_ptr getItemInstance(int id); Pos *getPos(int id); // 4J - using overloads rather than template here void set(int id, byte value); void set(int id, int value); void set(int id, short value); void set(int id, const wstring& value); - void set(int id, shared_ptr); + void set(int id, std::shared_ptr); void markDirty(int id); bool isDirty(); - static void pack(vector > *items, DataOutputStream *output); // TODO throws IOException - vector > *packDirty(); + static void pack(vector > *items, DataOutputStream *output); // TODO throws IOException + vector > *packDirty(); void packAll(DataOutputStream *output); // throws IOException - vector > *getAll(); + vector > *getAll(); private: - static void writeDataItem(DataOutputStream *output, shared_ptr dataItem); //throws IOException + static void writeDataItem(DataOutputStream *output, std::shared_ptr dataItem); //throws IOException public: - static vector > *unpack(DataInputStream *input); // throws IOException + static vector > *unpack(DataInputStream *input); // throws IOException /** * Assigns values from a list of data items. - * + * * @param items */ public: - void assignValues(vector > *items); + void assignValues(vector > *items); bool isEmpty(); // 4J Added -- cgit v1.2.3