From 6331ff9a4aeb99a16026c4f3f82f5c5965e26c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 17 Sep 2014 00:06:23 +0200 Subject: rename interfaces: Map Tile Pawn implementations: MapImage Hex PawnImage --- core/src/ch/asynk/tankontank/game/GameFactory.java | 6 +- core/src/ch/asynk/tankontank/game/Hex.java | 75 +++++++-- core/src/ch/asynk/tankontank/game/HexMap.java | 43 ------ core/src/ch/asynk/tankontank/game/HexMapImage.java | 167 --------------------- core/src/ch/asynk/tankontank/game/Map.java | 43 ++++++ core/src/ch/asynk/tankontank/game/MapHex.java | 69 --------- core/src/ch/asynk/tankontank/game/MapImage.java | 167 +++++++++++++++++++++ core/src/ch/asynk/tankontank/game/Pawn.java | 2 +- core/src/ch/asynk/tankontank/game/PawnImage.java | 6 +- core/src/ch/asynk/tankontank/game/Tile.java | 37 +++++ .../ch/asynk/tankontank/screens/GameScreen.java | 22 +-- 11 files changed, 327 insertions(+), 310 deletions(-) delete mode 100644 core/src/ch/asynk/tankontank/game/HexMap.java delete mode 100644 core/src/ch/asynk/tankontank/game/HexMapImage.java create mode 100644 core/src/ch/asynk/tankontank/game/Map.java delete mode 100644 core/src/ch/asynk/tankontank/game/MapHex.java create mode 100644 core/src/ch/asynk/tankontank/game/MapImage.java create mode 100644 core/src/ch/asynk/tankontank/game/Tile.java diff --git a/core/src/ch/asynk/tankontank/game/GameFactory.java b/core/src/ch/asynk/tankontank/game/GameFactory.java index 9dfdd6d..961a39a 100644 --- a/core/src/ch/asynk/tankontank/game/GameFactory.java +++ b/core/src/ch/asynk/tankontank/game/GameFactory.java @@ -123,13 +123,13 @@ public class GameFactory { Map.Config cfg = config(); - Hex[][] board = new Hex[cfg.rows][]; + Tile[][] board = new Tile[cfg.rows][]; for (int i = 0; i < cfg.rows; i++) { int c = cfg.cols; if ((i % 2) == 1) c -= 1; - board[i] = new Hex[c]; + board[i] = new Tile[c]; for ( int j = 0; j < c; j ++) - board[i][j] = new MapHex(MapHex.Terrain.CLEAR); + board[i][j] = new Hex(Hex.Terrain.CLEAR); } Map m = null; diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index b659b45..e3889f9 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -1,24 +1,69 @@ package ch.asynk.tankontank.game; -public interface Hex +import java.util.ArrayDeque; + +public class Hex implements Tile { - public int push(Pawn pawn); + public enum Terrain + { + CLEAR, + HILLS, + WOODS, + TOWN + } + + public Terrain terrain; + public int roads; + private ArrayDeque stack; + + public Hex(Terrain t) + { + this.terrain = t; + this.roads = 0; + this.stack = null; + } - public void remove(Pawn pawn); + public Hex(Terrain t, int roads) + { + this.terrain = t; + this.roads = roads; + this.stack = null; + } - public Pawn getTop(); + public int costFrom(Side side) + { + if (side.v == (roads & side.v)) return 1; + + int c = 0; + switch(terrain) { + case CLEAR: + case HILLS: + c = 1; + break; + case WOODS: + case TOWN: + c = 2; + break; + } + + return c; + } + + public int push(Pawn pawn) + { + if (stack == null) stack = new ArrayDeque(); + stack.push(pawn); + return stack.size(); + } + + public void remove(Pawn pawn) + { + stack.remove(pawn); + } - public enum Orientation + public Pawn getTop() { - KEEP(0), - WEST(-90), - NORTH_WEST(-30), - NORTH_EAST (30), - EAST(90), - SOUTH_EAST(150), - SOUTH_WEST(-150); - - public final int v; - Orientation(int v) { this.v = v; } + if ((stack == null) || (stack.size() == 0)) return null; + return stack.getFirst(); } } diff --git a/core/src/ch/asynk/tankontank/game/HexMap.java b/core/src/ch/asynk/tankontank/game/HexMap.java deleted file mode 100644 index 1d751a6..0000000 --- a/core/src/ch/asynk/tankontank/game/HexMap.java +++ /dev/null @@ -1,43 +0,0 @@ -package ch.asynk.tankontank.game; - -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.math.GridPoint2; - -public interface HexMap -{ - // libgdx - - public float getWidth(); - public float getHeight(); - - // game - - public GridPoint2 getHexAt(GridPoint2 hex, float x, float y); - - public Pawn getTopPawnAt(GridPoint2 hex); - - public Vector2 getHexCenterAt(GridPoint2 hex); - - public Vector2 getPawnPosAt(Pawn pawn, GridPoint2 hex); - - public void movePawnTo(Pawn pawn, Vector3 coords); - - public void setPawnAt(Pawn pawn, int col, int row, Hex.Orientation o); - - public void movePawnTo(Pawn pawn, int col, int row, Hex.Orientation o); - - public class Config - { - public int cols; - public int rows; - public int x0 = 83; // map offset - public int y0 = 182; // map offset - public int h = 110; // hex side - public float dh = 53.6f; // hex top should be h/2 - public int w = 189; // hex width - public int dw = 94; // half hex should be w/2 - public float H = h + dh; // total height - public float slope = (dh / (float) dw); - } -} diff --git a/core/src/ch/asynk/tankontank/game/HexMapImage.java b/core/src/ch/asynk/tankontank/game/HexMapImage.java deleted file mode 100644 index 59e35c3..0000000 --- a/core/src/ch/asynk/tankontank/game/HexMapImage.java +++ /dev/null @@ -1,167 +0,0 @@ -package ch.asynk.tankontank.game; - -import com.badlogic.gdx.Gdx; - -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.scenes.scene2d.ui.Image; - -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.math.GridPoint2; - -public class HexMapImage extends Image implements HexMap -{ - private HexMap.Config cfg; - private int cols; - private int rows; - private Hex[][] board; - - @SuppressWarnings("unchecked") - public HexMapImage(HexMap.Config cfg, Hex[][] board, Texture texture) - { - super(texture); - this.cfg = cfg; - this.board = board; - this.cols = cfg.cols - 1; - this.rows = cfg.rows - 1; - } - - public Pawn getTopPawnAt(GridPoint2 cell) - { - return getTopPawnAt(cell.x, cell.y); - } - - private Pawn getTopPawnAt(int col, int row) - { - // if ((col < 0) || (row < 0)) throw new (); - return board[row][col].getTop(); - } - - private int pushPawnAt(Pawn pawn, int col, int row) - { - // if ((col < 0) || (row < 0)) throw new (); - return board[row][col].push(pawn); - } - - private void removePawnFrom(Pawn pawn, int col, int row) - { - // if ((col < 0) || (row < 0)) throw new (); - board[row][col].remove(pawn); - } - - public Vector2 getHexCenterAt(GridPoint2 cell) - { - float x = cfg.x0 + ((cell.x * cfg.w) + (cfg.w / 2)); - float y = cfg.y0 + ((cell.y * cfg.H) + (cfg.h / 2)); - if ((cell.y % 2) == 1) x += cfg.dw; - return new Vector2(x, y); - } - - public Vector2 getPawnPosAt(Pawn pawn, GridPoint2 cell) - { - return getPawnPosAt(pawn, cell.x, cell.y); - } - - private Vector2 getPawnPosAt(Pawn pawn, int col, int row) - { - float x = cfg.x0 + ((col * cfg.w) + ((cfg.w - pawn.getHeight()) / 2)); - float y = cfg.y0 + ((row * cfg.H) + ((cfg.h - pawn.getWidth()) / 2)); - if ((row % 2) == 1) x += cfg.dw; - return new Vector2(x, y); - } - - public void movePawnTo(Pawn pawn, Vector3 coords) - { - GridPoint2 p = getHexAt(null, coords.x, coords.y); - movePawnTo(pawn, p.x, p.y, Hex.Orientation.KEEP); - } - - public void setPawnAt(final Pawn pawn, final int col, final int row, Hex.Orientation o) - { - int z = pushPawnAt(pawn, col, row); - Vector2 pos = getPawnPosAt(pawn, col, row); - pawn.pushMove(pos.x, pos.y, z, o); - } - - public void movePawnTo(final Pawn pawn, final int col, final int row, Hex.Orientation o) - { - GridPoint2 prev = getHexAt(pawn.getLastPosition()); - // if (prev == null) throw new (); - removePawnFrom(pawn, prev.x, prev.y); - - if ((col < 0) || (row < 0)) { - pawn.resetMoves(new Runnable() { - @Override - public void run() { - GridPoint2 hex = getHexAt(pawn.getLastPosition()); - pawn.setZIndex(pushPawnAt(pawn, hex.x, hex.y)); - } - }); - return; - } else { - int z = pushPawnAt(pawn, col, row); - Vector2 pos = getPawnPosAt(pawn, col, row); - pawn.pushMove(pos.x, pos.y, z, o); - } - } - - private GridPoint2 getHexAt(Vector3 v) - { - if (v == null) return null; - return getHexAt(null, v.x, v.y); - } - - public GridPoint2 getHexAt(GridPoint2 hex, float cx, float cy) - { - if (hex == null) hex = new GridPoint2(); - - // compute row - int row; - boolean oddRow = true; - float y = (cy - cfg.y0); - if (y < 0.f) { - row = -1; - } else { - row = (int) (y / cfg.H); - oddRow = ((row % 2) == 1); - } - - // compute col - int col; - float x = (cx - cfg.x0); - if (oddRow) x -= cfg.dw; - if (x < 0.f) { - col = -1; - } else { - col = (int) (x / cfg.w); - } - - // check upper boundaries - float dy = (y - (row * cfg.H)); - if (dy > cfg.h) { - dy -= cfg.h; - float dx = (x - (col * cfg.w)); - if (dx < cfg.dw) { - if ((dx * cfg.slope) < dy) { - row += 1; - if (!oddRow) col -= 1; - oddRow = !oddRow; - } - } else { - if (((cfg.w - dx) * cfg.slope) < dy) { - row += 1; - if (oddRow) col += 1; - oddRow = !oddRow; - } - } - } - - // validate hex - if ((col < 0) || (row < 0) || (row > rows) || (col > cols) || (oddRow && ((col +1)> cols))) - hex.set(-1, -1); - else - hex.set(col, row); - - return hex; - } -} diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java new file mode 100644 index 0000000..d410502 --- /dev/null +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -0,0 +1,43 @@ +package ch.asynk.tankontank.game; + +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.math.GridPoint2; + +public interface Map +{ + // libgdx + + public float getWidth(); + public float getHeight(); + + // game + + public GridPoint2 getHexAt(GridPoint2 hex, float x, float y); + + public Pawn getTopPawnAt(GridPoint2 hex); + + public Vector2 getHexCenterAt(GridPoint2 hex); + + public Vector2 getPawnPosAt(Pawn pawn, GridPoint2 hex); + + public void movePawnTo(Pawn pawn, Vector3 coords); + + public void setPawnAt(Pawn pawn, int col, int row, Tile.Orientation o); + + public void movePawnTo(Pawn pawn, int col, int row, Tile.Orientation o); + + public class Config + { + public int cols; + public int rows; + public int x0 = 83; // map offset + public int y0 = 182; // map offset + public int h = 110; // hex side + public float dh = 53.6f; // hex top should be h/2 + public int w = 189; // hex width + public int dw = 94; // half hex should be w/2 + public float H = h + dh; // total height + public float slope = (dh / (float) dw); + } +} diff --git a/core/src/ch/asynk/tankontank/game/MapHex.java b/core/src/ch/asynk/tankontank/game/MapHex.java deleted file mode 100644 index 6bf9893..0000000 --- a/core/src/ch/asynk/tankontank/game/MapHex.java +++ /dev/null @@ -1,69 +0,0 @@ -package ch.asynk.tankontank.game; - -import java.util.ArrayDeque; - -public class MapHex implements Hex -{ - public enum Terrain - { - CLEAR, - HILLS, - WOODS, - TOWN - } - - public Terrain terrain; - public int roads; - private ArrayDeque stack; - - public MapHex(Terrain t) - { - this.terrain = t; - this.roads = 0; - this.stack = null; - } - - public MapHex(Terrain t, int roads) - { - this.terrain = t; - this.roads = roads; - this.stack = null; - } - - public int costFrom(Side side) - { - if (side.v == (roads & side.v)) return 1; - - int c = 0; - switch(terrain) { - case CLEAR: - case HILLS: - c = 1; - break; - case WOODS: - case TOWN: - c = 2; - break; - } - - return c; - } - - public int push(Pawn pawn) - { - if (stack == null) stack = new ArrayDeque(); - stack.push(pawn); - return stack.size(); - } - - public void remove(Pawn pawn) - { - stack.remove(pawn); - } - - public Pawn getTop() - { - if ((stack == null) || (stack.size() == 0)) return null; - return stack.getFirst(); - } -} diff --git a/core/src/ch/asynk/tankontank/game/MapImage.java b/core/src/ch/asynk/tankontank/game/MapImage.java new file mode 100644 index 0000000..2bb330d --- /dev/null +++ b/core/src/ch/asynk/tankontank/game/MapImage.java @@ -0,0 +1,167 @@ +package ch.asynk.tankontank.game; + +import com.badlogic.gdx.Gdx; + +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.scenes.scene2d.ui.Image; + +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.math.GridPoint2; + +public class MapImage extends Image implements Map +{ + private Map.Config cfg; + private int cols; + private int rows; + private Tile[][] board; + + @SuppressWarnings("unchecked") + public MapImage(Map.Config cfg, Tile[][] board, Texture texture) + { + super(texture); + this.cfg = cfg; + this.board = board; + this.cols = cfg.cols - 1; + this.rows = cfg.rows - 1; + } + + public Pawn getTopPawnAt(GridPoint2 cell) + { + return getTopPawnAt(cell.x, cell.y); + } + + private Pawn getTopPawnAt(int col, int row) + { + // if ((col < 0) || (row < 0)) throw new (); + return board[row][col].getTop(); + } + + private int pushPawnAt(Pawn pawn, int col, int row) + { + // if ((col < 0) || (row < 0)) throw new (); + return board[row][col].push(pawn); + } + + private void removePawnFrom(Pawn pawn, int col, int row) + { + // if ((col < 0) || (row < 0)) throw new (); + board[row][col].remove(pawn); + } + + public Vector2 getHexCenterAt(GridPoint2 cell) + { + float x = cfg.x0 + ((cell.x * cfg.w) + (cfg.w / 2)); + float y = cfg.y0 + ((cell.y * cfg.H) + (cfg.h / 2)); + if ((cell.y % 2) == 1) x += cfg.dw; + return new Vector2(x, y); + } + + public Vector2 getPawnPosAt(Pawn pawn, GridPoint2 cell) + { + return getPawnPosAt(pawn, cell.x, cell.y); + } + + private Vector2 getPawnPosAt(Pawn pawn, int col, int row) + { + float x = cfg.x0 + ((col * cfg.w) + ((cfg.w - pawn.getHeight()) / 2)); + float y = cfg.y0 + ((row * cfg.H) + ((cfg.h - pawn.getWidth()) / 2)); + if ((row % 2) == 1) x += cfg.dw; + return new Vector2(x, y); + } + + public void movePawnTo(Pawn pawn, Vector3 coords) + { + GridPoint2 p = getHexAt(null, coords.x, coords.y); + movePawnTo(pawn, p.x, p.y, Tile.Orientation.KEEP); + } + + public void setPawnAt(final Pawn pawn, final int col, final int row, Tile.Orientation o) + { + int z = pushPawnAt(pawn, col, row); + Vector2 pos = getPawnPosAt(pawn, col, row); + pawn.pushMove(pos.x, pos.y, z, o); + } + + public void movePawnTo(final Pawn pawn, final int col, final int row, Tile.Orientation o) + { + GridPoint2 prev = getHexAt(pawn.getLastPosition()); + // if (prev == null) throw new (); + removePawnFrom(pawn, prev.x, prev.y); + + if ((col < 0) || (row < 0)) { + pawn.resetMoves(new Runnable() { + @Override + public void run() { + GridPoint2 hex = getHexAt(pawn.getLastPosition()); + pawn.setZIndex(pushPawnAt(pawn, hex.x, hex.y)); + } + }); + return; + } else { + int z = pushPawnAt(pawn, col, row); + Vector2 pos = getPawnPosAt(pawn, col, row); + pawn.pushMove(pos.x, pos.y, z, o); + } + } + + private GridPoint2 getHexAt(Vector3 v) + { + if (v == null) return null; + return getHexAt(null, v.x, v.y); + } + + public GridPoint2 getHexAt(GridPoint2 hex, float cx, float cy) + { + if (hex == null) hex = new GridPoint2(); + + // compute row + int row; + boolean oddRow = true; + float y = (cy - cfg.y0); + if (y < 0.f) { + row = -1; + } else { + row = (int) (y / cfg.H); + oddRow = ((row % 2) == 1); + } + + // compute col + int col; + float x = (cx - cfg.x0); + if (oddRow) x -= cfg.dw; + if (x < 0.f) { + col = -1; + } else { + col = (int) (x / cfg.w); + } + + // check upper boundaries + float dy = (y - (row * cfg.H)); + if (dy > cfg.h) { + dy -= cfg.h; + float dx = (x - (col * cfg.w)); + if (dx < cfg.dw) { + if ((dx * cfg.slope) < dy) { + row += 1; + if (!oddRow) col -= 1; + oddRow = !oddRow; + } + } else { + if (((cfg.w - dx) * cfg.slope) < dy) { + row += 1; + if (oddRow) col += 1; + oddRow = !oddRow; + } + } + } + + // validate hex + if ((col < 0) || (row < 0) || (row > rows) || (col > cols) || (oddRow && ((col +1)> cols))) + hex.set(-1, -1); + else + hex.set(col, row); + + return hex; + } +} diff --git a/core/src/ch/asynk/tankontank/game/Pawn.java b/core/src/ch/asynk/tankontank/game/Pawn.java index 71e225a..8bbdec4 100644 --- a/core/src/ch/asynk/tankontank/game/Pawn.java +++ b/core/src/ch/asynk/tankontank/game/Pawn.java @@ -16,7 +16,7 @@ public interface Pawn public void moveBy(float x, float y); - public void pushMove(float x, float y, int z, Hex.Orientation o); + public void pushMove(float x, float y, int z, Tile.Orientation o); public void resetMoves(Runnable cb); diff --git a/core/src/ch/asynk/tankontank/game/PawnImage.java b/core/src/ch/asynk/tankontank/game/PawnImage.java index 7f06504..d8b6d56 100644 --- a/core/src/ch/asynk/tankontank/game/PawnImage.java +++ b/core/src/ch/asynk/tankontank/game/PawnImage.java @@ -28,10 +28,10 @@ public class PawnImage extends Image implements Pawn return path.getFirst(); } - public void pushMove(float x, float y, int z, Hex.Orientation r) + public void pushMove(float x, float y, int z, Tile.Orientation r) { setPosition(x, y); - if (r != Hex.Orientation.KEEP) setRotation(r.v); + if (r != Tile.Orientation.KEEP) setRotation(r.v); setZIndex(z); path.push(new Vector3(x, y, r.v)); } @@ -45,7 +45,7 @@ public class PawnImage extends Image implements Pawn while(path.size() != 0) { Vector3 v = path.pop(); seq.addAction(Actions.moveTo(v.x, v.y, MOVE_TIME)); - if (v.z != Hex.Orientation.KEEP.v) + if (v.z != Tile.Orientation.KEEP.v) seq.addAction(Actions.rotateTo(v.z, ROTATE_TIME)); } diff --git a/core/src/ch/asynk/tankontank/game/Tile.java b/core/src/ch/asynk/tankontank/game/Tile.java new file mode 100644 index 0000000..a52e728 --- /dev/null +++ b/core/src/ch/asynk/tankontank/game/Tile.java @@ -0,0 +1,37 @@ +package ch.asynk.tankontank.game; + +public interface Tile +{ + public int push(Pawn pawn); + + public void remove(Pawn pawn); + + public Pawn getTop(); + + public enum Orientation + { + KEEP(0), + WEST(-90), + NORTH_WEST(-30), + NORTH_EAST (30), + EAST(90), + SOUTH_EAST(150), + SOUTH_WEST(-150); + + public final int v; + Orientation(int v) { this.v = v; } + } + + public enum Side + { + WEST(1), + NORTH_WEST(2), + NORTH_EAST (4), + EAST(8), + SOUTH_EAST(16), + SOUTH_WEST(32); + + public final int v; + Side(int v) { this.v = v; } + } +} diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java index 8118489..731db63 100644 --- a/core/src/ch/asynk/tankontank/screens/GameScreen.java +++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java @@ -25,13 +25,17 @@ import com.badlogic.gdx.utils.viewport.FitViewport; import com.badlogic.gdx.utils.viewport.ScreenViewport; import ch.asynk.tankontank.TankOnTank; + import ch.asynk.tankontank.game.GameFactory; import ch.asynk.tankontank.game.GameFactory.UnitType; + +// interfaces +import ch.asynk.tankontank.game.Map; +import ch.asynk.tankontank.game.Tile; import ch.asynk.tankontank.game.Pawn; -import ch.asynk.tankontank.game.HexMap; -import ch.asynk.tankontank.game.Hex; -import ch.asynk.tankontank.game.HexMapImage; -import ch.asynk.tankontank.game.Unit; + +import ch.asynk.tankontank.game.MapImage; // addActor +import ch.asynk.tankontank.game.Unit; // addActor public class GameScreen extends AbstractScreen { @@ -43,7 +47,7 @@ public class GameScreen extends AbstractScreen private float maxZoomOut; final OrthographicCamera cam; - private HexMap map; + private Map map; private Image selectedHex; private Label fps; @@ -75,11 +79,11 @@ public class GameScreen extends AbstractScreen // cam.position.set((map.getWidth()/2), (map.getHeight()/2), 0); gameStage = new Stage(new FitViewport(map.getWidth(), map.getHeight(), cam)); - gameStage.addActor((HexMapImage) map); + gameStage.addActor((MapImage) map); gameStage.addActor(selectedHex); - Hex.Orientation o = Hex.Orientation.SOUTH_EAST; + Tile.Orientation o = Tile.Orientation.SOUTH_EAST; addUnit(gameStage, UnitType.GE_AT_GUN, 1, 4, o); addUnit(gameStage, UnitType.GE_INFANTRY, 2, 4, o); addUnit(gameStage, UnitType.GE_KINGTIGER, 3, 4, o); @@ -88,7 +92,7 @@ public class GameScreen extends AbstractScreen addUnit(gameStage, UnitType.GE_TIGER, 6, 4, o); addUnit(gameStage, UnitType.GE_WESPE, 7, 4, o); - o = Hex.Orientation.NORTH_WEST; + o = Tile.Orientation.NORTH_WEST; addUnit(gameStage, UnitType.US_AT_GUN, 1, 3, o); addUnit(gameStage, UnitType.US_INFANTRY, 2, 3, o); addUnit(gameStage, UnitType.US_PERSHING, 3, 3, o); @@ -104,7 +108,7 @@ public class GameScreen extends AbstractScreen Gdx.input.setInputProcessor(getMultiplexer()); } - private void addUnit(Stage stage, UnitType t, int col, int row, Hex.Orientation o) + private void addUnit(Stage stage, UnitType t, int col, int row, Tile.Orientation o) { Unit u = GameFactory.getUnit(t); map.setPawnAt((Pawn) u, col, row, o); -- cgit v1.1-2-g2b99