Added ability to move units
This commit is contained in:
parent
7c5cbe83fa
commit
ef64874f36
3 changed files with 19 additions and 13 deletions
|
|
@ -69,16 +69,9 @@ public class Map {
|
|||
* @return True if empty else false
|
||||
*/
|
||||
public boolean isPosEmpty(int x, int y){
|
||||
if(map[x][y] != null){
|
||||
if(map[x][y] == null){
|
||||
return true;
|
||||
}
|
||||
for(int i=0; i<width ;i++){
|
||||
for(int j=0; j<hight ;j++){
|
||||
if(map[i][j] != null){
|
||||
System.out.println("LOL: "+i+" "+j);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -122,4 +115,18 @@ public class Map {
|
|||
public Node getMapNode(){
|
||||
return mapNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints all the units on the map
|
||||
*
|
||||
*/
|
||||
public void printAllUnits(){
|
||||
for(int i=0; i<width ;i++){
|
||||
for(int j=0; j<hight ;j++){
|
||||
if(map[i][j] != null){
|
||||
System.out.println("LOL: "+i+" "+j);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue