This commit is contained in:
parent
a2d6b68992
commit
901206c108
2 changed files with 27 additions and 15 deletions
|
|
@ -134,6 +134,17 @@ public class Map {
|
|||
return mapNode;
|
||||
}
|
||||
|
||||
public Vector2i getPosIndex(GameEntity u){
|
||||
for(int i=0; i<width ;i++){
|
||||
for(int j=0; j<hight ;j++){
|
||||
if(map[i][j] == u){
|
||||
return new Vector2i(i,j);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints all the units on the map
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue