diff options
| author | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
|---|---|---|
| committer | void_17 <heroerror3@gmail.com> | 2026-03-02 15:58:20 +0700 |
| commit | 7074f35e4ba831e358117842b99ee35b87f85ae5 (patch) | |
| tree | 7d440d23473196af3056bf2ff4c59d9e740a06f5 /Minecraft.Client/PlayerChunkMap.h | |
| parent | d63f79325f85e014361eb8cf1e41eaebedb1ae71 (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.Client/PlayerChunkMap.h')
| -rw-r--r-- | Minecraft.Client/PlayerChunkMap.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Minecraft.Client/PlayerChunkMap.h b/Minecraft.Client/PlayerChunkMap.h index 08cda2a7..5e87934b 100644 --- a/Minecraft.Client/PlayerChunkMap.h +++ b/Minecraft.Client/PlayerChunkMap.h @@ -25,8 +25,8 @@ public: { public: int x,z; - shared_ptr<ServerPlayer> player; - PlayerChunkAddRequest(int x, int z, shared_ptr<ServerPlayer> player ) : x(x), z(z), player(player) {} + std::shared_ptr<ServerPlayer> player; + PlayerChunkAddRequest(int x, int z, std::shared_ptr<ServerPlayer> player ) : x(x), z(z), player(player) {} }; class PlayerChunk @@ -34,7 +34,7 @@ public: friend class PlayerChunkMap; private: PlayerChunkMap *parent; // 4J added - vector<shared_ptr<ServerPlayer> > players; + vector<std::shared_ptr<ServerPlayer> > players; //int x, z; ChunkPos pos; @@ -51,25 +51,25 @@ public: ~PlayerChunk(); // 4J Added sendPacket param so we can aggregate the initial send into one much smaller packet - void add(shared_ptr<ServerPlayer> player, bool sendPacket = true); - void remove(shared_ptr<ServerPlayer> player); + void add(std::shared_ptr<ServerPlayer> player, bool sendPacket = true); + void remove(std::shared_ptr<ServerPlayer> player); void tileChanged(int x, int y, int z); void prioritiseTileChanges(); // 4J added - void broadcast(shared_ptr<Packet> packet); + void broadcast(std::shared_ptr<Packet> packet); bool broadcastChanges(bool allowRegionUpdate); // 4J - added parm private: - void broadcast(shared_ptr<TileEntity> te); + void broadcast(std::shared_ptr<TileEntity> te); }; public: - vector<shared_ptr<ServerPlayer> > players; + vector<std::shared_ptr<ServerPlayer> > players; void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added private: unordered_map<int64_t,PlayerChunk *,LongKeyHash,LongKeyEq> chunks; // 4J - was LongHashMap vector<PlayerChunk *> changedChunks; vector<PlayerChunkAddRequest> addRequests; // 4J added - void tickAddRequests(shared_ptr<ServerPlayer> player); // 4J added + void tickAddRequests(std::shared_ptr<ServerPlayer> player); // 4J added ServerLevel *level; int radius; @@ -83,21 +83,21 @@ public: bool hasChunk(int x, int z); private: PlayerChunk *getChunk(int x, int z, bool create); - void getChunkAndAddPlayer(int x, int z, shared_ptr<ServerPlayer> player); // 4J added - void getChunkAndRemovePlayer(int x, int z, shared_ptr<ServerPlayer> player); // 4J added + void getChunkAndAddPlayer(int x, int z, std::shared_ptr<ServerPlayer> player); // 4J added + void getChunkAndRemovePlayer(int x, int z, std::shared_ptr<ServerPlayer> player); // 4J added public: - void broadcastTileUpdate(shared_ptr<Packet> packet, int x, int y, int z); + void broadcastTileUpdate(std::shared_ptr<Packet> packet, int x, int y, int z); void tileChanged(int x, int y, int z); bool isTrackingTile(int x, int y, int z); // 4J added void prioritiseTileChanges(int x, int y, int z); // 4J added - void add(shared_ptr<ServerPlayer> player); - void remove(shared_ptr<ServerPlayer> player); + void add(std::shared_ptr<ServerPlayer> player); + void remove(std::shared_ptr<ServerPlayer> player); private: bool chunkInRange(int x, int z, int xc, int zc); public: - void move(shared_ptr<ServerPlayer> player); + void move(std::shared_ptr<ServerPlayer> player); int getMaxRange(); - bool isPlayerIn(shared_ptr<ServerPlayer> player, int xChunk, int zChunk); + bool isPlayerIn(std::shared_ptr<ServerPlayer> player, int xChunk, int zChunk); static int convertChunkRangeToBlock(int radius); // AP added for Vita |
