summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/Classes/Geometry.lua8
-rw-r--r--src/Cuboid.cpp14
-rw-r--r--src/Cuboid.h1
3 files changed, 21 insertions, 2 deletions
diff --git a/MCServer/Plugins/APIDump/Classes/Geometry.lua b/MCServer/Plugins/APIDump/Classes/Geometry.lua
index 6f95c4cbf..78cd94f0c 100644
--- a/MCServer/Plugins/APIDump/Classes/Geometry.lua
+++ b/MCServer/Plugins/APIDump/Classes/Geometry.lua
@@ -63,12 +63,16 @@ return
{
constructor =
{
- { Params = "OtheCuboid", Return = "cCuboid", Notes = "Creates a new Cuboid object as a copy of OtherCuboid" },
+ { Params = "OtherCuboid", Return = "cCuboid", Notes = "Creates a new Cuboid object as a copy of OtherCuboid" },
{ Params = "{{Vector3i|Point1}}, {{Vector3i|Point2}}", Return = "cCuboid", Notes = "Creates a new Cuboid object with the specified points as its corners." },
{ Params = "X, Y, Z", Return = "cCuboid", Notes = "Creates a new Cuboid object with the specified point as both its corners (the cuboid has a size of 1 in each direction)." },
{ Params = "X1, Y1, Z1, X2, Y2, Z2", Return = "cCuboid", Notes = "Creates a new Cuboid object with the specified points as its corners." },
},
- Assign = { Params = "X1, Y1, Z1, X2, Y2, Z2", Return = "", Notes = "Assigns all the coords stored in the cuboid. Sort-state is ignored." },
+ Assign =
+ {
+ { Params = "SrcCuboid", Return = "", Notes = "Copies all the coords from the src cuboid to this cuboid. Sort-state is ignored." },
+ { Params = "X1, Y1, Z1, X2, Y2, Z2", Return = "", Notes = "Assigns all the coords to the specified values. Sort-state is ignored." },
+ },
ClampX = { Params = "MinX, MaxX", Return = "", Notes = "Clamps both X coords into the range provided. Sortedness-agnostic." },
ClampY = { Params = "MinY, MaxY", Return = "", Notes = "Clamps both Y coords into the range provided. Sortedness-agnostic." },
ClampZ = { Params = "MinZ, MaxZ", Return = "", Notes = "Clamps both Z coords into the range provided. Sortedness-agnostic." },
diff --git a/src/Cuboid.cpp b/src/Cuboid.cpp
index 2400c64f3..3e5240248 100644
--- a/src/Cuboid.cpp
+++ b/src/Cuboid.cpp
@@ -38,6 +38,20 @@ void cCuboid::Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2)
+void cCuboid::Assign(const cCuboid & a_SrcCuboid)
+{
+ p1.x = a_SrcCuboid.p1.x;
+ p1.y = a_SrcCuboid.p1.y;
+ p1.z = a_SrcCuboid.p1.z;
+ p2.x = a_SrcCuboid.p2.x;
+ p2.y = a_SrcCuboid.p2.y;
+ p2.z = a_SrcCuboid.p2.z;
+}
+
+
+
+
+
void cCuboid::Sort(void)
{
if (p1.x > p2.x)
diff --git a/src/Cuboid.h b/src/Cuboid.h
index b90a09e05..3239c54fc 100644
--- a/src/Cuboid.h
+++ b/src/Cuboid.h
@@ -21,6 +21,7 @@ public:
cCuboid(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2) : p1(a_X1, a_Y1, a_Z1), p2(a_X2, a_Y2, a_Z2) {}
void Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2);
+ void Assign(const cCuboid & a_SrcCuboid);
void Sort(void);