Override getString() method in vector types
This commit is contained in:
parent
09b244ef74
commit
55091d3cd1
4 changed files with 52 additions and 0 deletions
|
@ -21,6 +21,7 @@ package de.staropensource.sosengine.base.types.vectors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a 2D float Vector.
|
* Represents a 2D float Vector.
|
||||||
|
@ -80,4 +81,16 @@ public class Vec2 {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of this vector.
|
||||||
|
*
|
||||||
|
* @return string representation
|
||||||
|
* @since v1-alpha2
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getName() + "(x=" + x + " y=" + y + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package de.staropensource.sosengine.base.types.vectors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a 2D integer Vector.
|
* Represents a 2D integer Vector.
|
||||||
|
@ -80,4 +81,16 @@ public class Vec2i {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of this vector.
|
||||||
|
*
|
||||||
|
* @return string representation
|
||||||
|
* @since v1-alpha2
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getName() + "(x=" + x + " y=" + y + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package de.staropensource.sosengine.base.types.vectors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a 3D float Vector.
|
* Represents a 3D float Vector.
|
||||||
|
@ -101,4 +102,16 @@ public class Vec3 {
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of this vector.
|
||||||
|
*
|
||||||
|
* @return string representation
|
||||||
|
* @since v1-alpha2
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getName() + "(x=" + x + " y=" + y + " z=" + z + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ package de.staropensource.sosengine.base.types.vectors;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a 3D integer Vector.
|
* Represents a 3D integer Vector.
|
||||||
|
@ -101,4 +102,16 @@ public class Vec3i {
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of this vector.
|
||||||
|
*
|
||||||
|
* @return string representation
|
||||||
|
* @since v1-alpha2
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getClass().getName() + "(x=" + x + " y=" + y + " z=" + z + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue