aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Path.cpp
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/Path.cpp
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/Path.cpp')
-rw-r--r--Minecraft.World/Path.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.World/Path.cpp b/Minecraft.World/Path.cpp
index 538917f6..61bd055e 100644
--- a/Minecraft.World/Path.cpp
+++ b/Minecraft.World/Path.cpp
@@ -13,7 +13,7 @@ Path::~Path()
}
}
-Path::Path(NodeArray nodes)
+Path::Path(NodeArray nodes)
{
index = 0;
@@ -30,26 +30,26 @@ Path::Path(NodeArray nodes)
}
}
-void Path::next()
+void Path::next()
{
index++;
}
-bool Path::isDone()
+bool Path::isDone()
{
return index >= length;
}
-Node *Path::last()
+Node *Path::last()
{
- if (length > 0)
+ if (length > 0)
{
return nodes[length - 1];
}
return NULL;
}
-Node *Path::get(int i)
+Node *Path::get(int i)
{
return nodes[i];
}
@@ -74,7 +74,7 @@ void Path::setIndex(int index)
this->index = index;
}
-Vec3 *Path::getPos(shared_ptr<Entity> e, int index)
+Vec3 *Path::getPos(std::shared_ptr<Entity> e, int index)
{
double x = nodes[index]->x + (int) (e->bbWidth + 1) * 0.5;
double y = nodes[index]->y;
@@ -82,7 +82,7 @@ Vec3 *Path::getPos(shared_ptr<Entity> e, int index)
return Vec3::newTemp(x, y, z);
}
-Vec3 *Path::currentPos(shared_ptr<Entity> e)
+Vec3 *Path::currentPos(std::shared_ptr<Entity> e)
{
return getPos(e, index);
}