Fixed some warnings
This commit is contained in:
parent
5afe36149f
commit
ac1e224d26
4 changed files with 12 additions and 12 deletions
|
|
@ -6,7 +6,7 @@ package ei.engine.math;
|
|||
* @author Ziver
|
||||
*/
|
||||
|
||||
public class Vector2f implements Comparable{
|
||||
public class Vector2f implements Comparable<Vector2f>{
|
||||
private float x;
|
||||
private float y;
|
||||
|
||||
|
|
@ -79,10 +79,10 @@ public class Vector2f implements Comparable{
|
|||
}
|
||||
|
||||
|
||||
public int compareTo(Object v) {
|
||||
if(x+y > ((Vector2f) v).getX()+((Vector2f) v).getY())
|
||||
public int compareTo(Vector2f v) {
|
||||
if(x+y > v.getX()+v.getY())
|
||||
return 1;
|
||||
else if(x+y < ((Vector2f) v).getX()+((Vector2f) v).getY())
|
||||
else if(x+y < v.getX()+v.getY())
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package ei.engine.math;
|
|||
* @author Ziver
|
||||
*/
|
||||
|
||||
public class Vector2i implements Comparable{
|
||||
public class Vector2i implements Comparable<Vector2i>{
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
|
|
@ -76,10 +76,10 @@ public class Vector2i implements Comparable{
|
|||
return "Vector2i["+x+","+y+"]";
|
||||
}
|
||||
|
||||
public int compareTo(Object v) {
|
||||
if(x+y > ((Vector2i) v).getX()+((Vector2i) v).getY())
|
||||
public int compareTo(Vector2i v) {
|
||||
if(x+y > v.getX()+v.getY())
|
||||
return 1;
|
||||
else if(x+y < ((Vector2i) v).getX()+((Vector2i) v).getY())
|
||||
else if(x+y < v.getX()+v.getY())
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class TextureLoader {
|
|||
* @throws IOException Indicates a failure to access the resource
|
||||
*/
|
||||
public Texture getTexture(String resourceName){
|
||||
Texture tex = (Texture) table.get(resourceName);
|
||||
Texture tex = table.get(resourceName);
|
||||
|
||||
if (tex != null) {
|
||||
return tex;
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ public strictfp class AStarPathFinder implements PathFinder {
|
|||
*
|
||||
* @author Kevin Glass
|
||||
*/
|
||||
private class Step implements Comparable {
|
||||
private class Step implements Comparable<Step> {
|
||||
/** The x position of this step */
|
||||
public int x;
|
||||
/** The y position of this step */
|
||||
|
|
@ -315,8 +315,8 @@ public strictfp class AStarPathFinder implements PathFinder {
|
|||
/**
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
public int compareTo(Object o) {
|
||||
return h - ((Step) o).h;
|
||||
public int compareTo(Step o) {
|
||||
return h - o.h;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue