Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bridger.game.world.Map;
- public class AStarMap
- {
- private int[][] map;
- public AStarMap(Map tMap)
- {
- map = new int[tMap.getMapHeight()][tMap.getMapWidth()];
- for (int i = 0; i < map.length; i++)
- {
- for (int j = 0; j < map[i].length; j++)
- {
- if (tMap.isWalkable(j, i))
- {
- map[i][j] = 1;
- }
- else
- {
- map[i][j] = 0;
- }
- }
- }
- }
- public void printMap()
- {
- System.out.println();System.out.println("Printing Map");System.out.println();
- for (int i = 0; i < map.length; i++)
- {
- for (int j = 0; j < map[i].length; j++)
- {
- System.out.print(" " + map[i][j]);
- }
- System.out.println();
- }
- }
- public int[][] getMap()
- {
- return map;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement