Added a few functions to BlockCoord

Made RedundantTransformation more redundant
This commit is contained in:
Chicken Bones committed 2013-09-04 12:51:37 +10:00
1 parent 5ef9f6174d
commit c545683025
2 files changed
+25

No files matched your search

+20
View File
@@ -177,4 +177,24 @@ public class BlockCoord implements Comparable<BlockCoord>
{
return set(coord.x, coord.y, coord.z);
}
public int toSide()
{
if(!isAxial()) return -1;
if(y < 0) return 0;
if(y > 0) return 1;
if(z < 0) return 2;
if(z > 0) return 3;
if(x < 0) return 4;
if(x > 0) return 5;
return -1;
}
public int absSum()
{
return (x < 0 ? -x : x) +
(y < 0 ? -y : y) +
(z < 0 ? -z : z);
}
}
@@ -30,6 +30,11 @@ public class RedundantTransformation extends Transformation
return this;
}
@Override
public Transformation merge(Transformation next) {
return next;
}
@Override
public String toString()
{