From 39bcc7375c7d9c17922ec76be6f7834ae8211b82 Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Sat, 9 Jan 2016 18:55:44 +0100 Subject: Tile: add constructor param int capacity (of the stack) --- core/src/ch/asynk/rustanddust/game/Factory.java | 4 +++- core/src/ch/asynk/rustanddust/game/Hex.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'core/src/ch/asynk/rustanddust/game') diff --git a/core/src/ch/asynk/rustanddust/game/Factory.java b/core/src/ch/asynk/rustanddust/game/Factory.java index a16fb49b..4d67eb52 100644 --- a/core/src/ch/asynk/rustanddust/game/Factory.java +++ b/core/src/ch/asynk/rustanddust/game/Factory.java @@ -29,6 +29,8 @@ public class Factory implements Board.TileBuilder, Disposable public static final String ENABLED = "enabled"; public static final String REINFORCEMENT = "reinforcement"; + public static final int HEX_CAPACITY = 1; + public enum MapType { MAP_00, @@ -213,7 +215,7 @@ public class Factory implements Board.TileBuilder, Disposable public Hex getNewTile(float x, float y, int col, int row, boolean offmap) { - Hex hex = new Hex(x, y, col, row, hexOverlaysAtlas, Army.NONE); + Hex hex = new Hex(x, y, col, row, HEX_CAPACITY, Army.NONE, hexOverlaysAtlas); if (offmap) hex.terrain = Hex.Terrain.OFFMAP; return hex; } diff --git a/core/src/ch/asynk/rustanddust/game/Hex.java b/core/src/ch/asynk/rustanddust/game/Hex.java index f5a990ec..7b37dee0 100644 --- a/core/src/ch/asynk/rustanddust/game/Hex.java +++ b/core/src/ch/asynk/rustanddust/game/Hex.java @@ -43,9 +43,9 @@ public class Hex extends Tile return String.format("(%d;%d)", col, row); } - public Hex(float x, float y, int col, int row, TextureAtlas atlas, Army defaultArmy) + public Hex(float x, float y, int col, int row, int capacity, Army defaultArmy, TextureAtlas atlas) { - super(x, y, col, row, atlas, defaultArmy); + super(x, y, col, row, capacity, defaultArmy, atlas); this.terrain = Terrain.CLEAR; this.roads = 0; } -- cgit v1.2.3