diff --git a/src/main/java/cactusServer/entities/Depth3D.java b/src/main/java/cactusServer/entities/Depth3D.java new file mode 100644 index 0000000..c12721c --- /dev/null +++ b/src/main/java/cactusServer/entities/Depth3D.java @@ -0,0 +1,32 @@ +package cactusServer.entities; + +public class Depth3D { + double depthX,depthY,depthZ; + private Depth3D() { + //Json�f�R�[�h�p + } + + public double getDepthX() { + return depthX; + } + + public void setDepthX(double depthX) { + this.depthX = depthX; + } + + public double getDepthY() { + return depthY; + } + + public void setDepthY(double depthY) { + this.depthY = depthY; + } + + public double getDepthZ() { + return depthZ; + } + + public void setDepthZ(double depthZ) { + this.depthZ = depthZ; + } +} diff --git a/src/main/java/cactusServer/entities/Object.java b/src/main/java/cactusServer/entities/Object.java index 42eded1..1e37907 100644 --- a/src/main/java/cactusServer/entities/Object.java +++ b/src/main/java/cactusServer/entities/Object.java @@ -9,17 +9,20 @@ private Position3D position; private Velocity3D velocity; private AngularVelocity3D angularVelocity; + private Depth3D depth; private Angle angle; private Attribute attribute; private String model; - @JSONHint(ignore = true) public static final int UNIQUE_ID_LENGTH = 12; + + @JSONHint(ignore = true) + public static final int UNIQUE_ID_LENGTH = 12; private Object() { // JSONDecode���̌Ăяo���p } - + public Object(Position3D position, Velocity3D velocity, AngularVelocity3D angularVelocity, Angle angle, - Attribute attribute, String model) { + Attribute attribute, String model) { setPosition(position); setVelocity(velocity); setAngularVelocity(angularVelocity); @@ -27,6 +30,17 @@ setAttribute(attribute); setModel(model); } + + public Object(Position3D position, Velocity3D velocity, AngularVelocity3D angularVelocity, Angle angle, + Depth3D depth, Attribute attribute, String model) { + setPosition(position); + setVelocity(velocity); + setAngularVelocity(angularVelocity); + setAngle(angle); + setDepth(depth); + setAttribute(attribute); + setModel(model); + } public Position3D getPosition() { return position; @@ -44,6 +58,10 @@ return angle; } + public Depth3D getDepth() { + return depth; + } + public Attribute getAttribute() { return attribute; } @@ -67,6 +85,10 @@ public void setAngle(Angle angle) { this.angle = angle; } + + public void setDepth(Depth3D depth) { + this.depth = depth; + } public void setAttribute(Attribute attribute) { this.attribute = attribute; @@ -101,4 +123,20 @@ this.cof = cof; } } -} + + public boolean isPerDesion(Object another) { + Position3D ap = another.getPosition(); + if (position.getX() == ap.getX() && position.getY() == ap.getY() && position.getZ() == ap.getZ()) { + return true; + } + return false; + } + + public boolean isPerDesion(Player another) { + Position3D ap = another.getPosition(); + if (position.getX() == ap.getX() && position.getY() == ap.getY() && position.getZ() == ap.getZ()) { + return true; + } + return false; + } +} \ No newline at end of file