FIXED ASTAR NOW WORKING!!!!!!!
This commit is contained in:
parent
acde8264af
commit
5e17bdd5e5
10 changed files with 592 additions and 19 deletions
|
|
@ -6,7 +6,7 @@ package ei.engine.math;
|
|||
* @author Ziver
|
||||
*/
|
||||
|
||||
public class Vector2f {
|
||||
public class Vector2f implements Comparable{
|
||||
private float x;
|
||||
private float y;
|
||||
|
||||
|
|
@ -67,4 +67,14 @@ public class Vector2f {
|
|||
public String toString(){
|
||||
return "Vector2f["+x+","+y+"]";
|
||||
}
|
||||
|
||||
|
||||
public int compareTo(Object v) {
|
||||
if(x+y > ((Vector2f) v).getX()+((Vector2f) v).getY())
|
||||
return 1;
|
||||
else if(x+y < ((Vector2f) v).getX()+((Vector2f) v).getY())
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package ei.engine.math;
|
|||
* @author Ziver
|
||||
*/
|
||||
|
||||
public class Vector2i {
|
||||
public class Vector2i implements Comparable{
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
|
|
@ -55,7 +55,25 @@ public class Vector2i {
|
|||
y += i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a copy of this vector
|
||||
*
|
||||
* @return A copy of this vector
|
||||
*/
|
||||
public Vector2i getCopy(){
|
||||
return new Vector2i(x,y);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return "Vector2i["+x+","+y+"]";
|
||||
}
|
||||
|
||||
public int compareTo(Object v) {
|
||||
if(x+y > ((Vector2i) v).getX()+((Vector2i) v).getY())
|
||||
return 1;
|
||||
else if(x+y < ((Vector2i) v).getX()+((Vector2i) v).getY())
|
||||
return -1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue