aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/SynchedEntityData.h
diff options
context:
space:
mode:
authorvoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
committervoid_17 <heroerror3@gmail.com>2026-03-02 15:58:20 +0700
commit7074f35e4ba831e358117842b99ee35b87f85ae5 (patch)
tree7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.World/SynchedEntityData.h
parentd63f79325f85e014361eb8cf1e41eaebedb1ae71 (diff)
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.
Diffstat (limited to 'Minecraft.World/SynchedEntityData.h')
-rw-r--r--Minecraft.World/SynchedEntityData.h28
1 files changed, 14 insertions, 14 deletions
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<ItemInstance> value_itemInstance;
+ std::shared_ptr<ItemInstance> 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> itemInstance);
+ DataItem(int type, int id, std::shared_ptr<ItemInstance> 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<ItemInstance> value);
+ void setValue(std::shared_ptr<ItemInstance> value);
byte getValue_byte();
int getValue_int();
short getValue_short();
wstring getValue_wstring();
- shared_ptr<ItemInstance> getValue_itemInstance();
+ std::shared_ptr<ItemInstance> 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<int, shared_ptr<DataItem> > itemsById;
+ unordered_map<int, std::shared_ptr<DataItem> > itemsById;
bool m_isDirty;
public:
@@ -91,35 +91,35 @@ public:
int getInteger(int id);
float getFloat(int id);
wstring getString(int id);
- shared_ptr<ItemInstance> getItemInstance(int id);
+ std::shared_ptr<ItemInstance> 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<ItemInstance>);
+ void set(int id, std::shared_ptr<ItemInstance>);
void markDirty(int id);
bool isDirty();
- static void pack(vector<shared_ptr<DataItem> > *items, DataOutputStream *output); // TODO throws IOException
- vector<shared_ptr<DataItem> > *packDirty();
+ static void pack(vector<std::shared_ptr<DataItem> > *items, DataOutputStream *output); // TODO throws IOException
+ vector<std::shared_ptr<DataItem> > *packDirty();
void packAll(DataOutputStream *output); // throws IOException
- vector<shared_ptr<DataItem> > *getAll();
+ vector<std::shared_ptr<DataItem> > *getAll();
private:
- static void writeDataItem(DataOutputStream *output, shared_ptr<DataItem> dataItem); //throws IOException
+ static void writeDataItem(DataOutputStream *output, std::shared_ptr<DataItem> dataItem); //throws IOException
public:
- static vector<shared_ptr<DataItem> > *unpack(DataInputStream *input); // throws IOException
+ static vector<std::shared_ptr<DataItem> > *unpack(DataInputStream *input); // throws IOException
/**
* Assigns values from a list of data items.
- *
+ *
* @param items
*/
public:
- void assignValues(vector<shared_ptr<DataItem> > *items);
+ void assignValues(vector<std::shared_ptr<DataItem> > *items);
bool isEmpty();
// 4J Added