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.
This commit is contained in:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -12,28 +12,28 @@ ContainerSetContentPacket::~ContainerSetContentPacket()
delete[] items.data;
}
ContainerSetContentPacket::ContainerSetContentPacket()
ContainerSetContentPacket::ContainerSetContentPacket()
{
containerId = 0;
}
ContainerSetContentPacket::ContainerSetContentPacket(int containerId, vector<shared_ptr<ItemInstance> > *newItems)
ContainerSetContentPacket::ContainerSetContentPacket(int containerId, vector<std::shared_ptr<ItemInstance> > *newItems)
{
this->containerId = containerId;
items = ItemInstanceArray((int)newItems->size());
for (unsigned int i = 0; i < items.length; i++)
{
shared_ptr<ItemInstance> item = newItems->at(i);
std::shared_ptr<ItemInstance> item = newItems->at(i);
items[i] = item == NULL ? nullptr : item->copy();
}
}
void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException
void ContainerSetContentPacket::read(DataInputStream *dis) //throws IOException
{
containerId = dis->readByte();
int count = dis->readShort();
items = ItemInstanceArray(count);
for (int i = 0; i < count; i++)
for (int i = 0; i < count; i++)
{
items[i] = readItem(dis);
}
@@ -43,7 +43,7 @@ void ContainerSetContentPacket::write(DataOutputStream *dos) //throws IOExceptio
{
dos->writeByte(containerId);
dos->writeShort(items.length);
for (unsigned int i = 0; i < items.length; i++)
for (unsigned int i = 0; i < items.length; i++)
{
writeItem(items[i], dos);
}
@@ -54,7 +54,7 @@ void ContainerSetContentPacket::handle(PacketListener *listener)
listener->handleContainerContent(shared_from_this());
}
int ContainerSetContentPacket::getEstimatedSize()
int ContainerSetContentPacket::getEstimatedSize()
{
return 3 + items.length * 5;
}