mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Code cleanup
This commit is contained in:
@@ -41,9 +41,12 @@ import forge.util.ItemPool;
|
|||||||
public class ConquestDataIO {
|
public class ConquestDataIO {
|
||||||
public static boolean TEST_MODE = true;
|
public static boolean TEST_MODE = true;
|
||||||
private static ConquestData createTestData() {
|
private static ConquestData createTestData() {
|
||||||
ConquestData temp = new ConquestData("My Conquest", 0,
|
/*ConquestData temp = new ConquestData("My Conquest", 0,
|
||||||
ConquestPlane.Alara,
|
ConquestPlane.Alara,
|
||||||
ConquestPlane.Alara.getCardPool().getCard("Rafiq of the Many"));
|
ConquestPlane.Alara.getCardPool().getCard("Rafiq of the Many"));*/
|
||||||
|
ConquestData temp = new ConquestData("My Conquest", 0,
|
||||||
|
ConquestPlane.Kamigawa,
|
||||||
|
ConquestPlane.Kamigawa.getCardPool().getCard("Meloku the Clouded Mirror"));
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package forge.planarconquest;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.base.Predicates;
|
|
||||||
|
|
||||||
import forge.GuiBase;
|
import forge.GuiBase;
|
||||||
import forge.assets.ISkinImage;
|
import forge.assets.ISkinImage;
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ public class ConquestPlaneMap {
|
|||||||
//use 2 dimensional array to represent tile grid
|
//use 2 dimensional array to represent tile grid
|
||||||
private final int gridSize;
|
private final int gridSize;
|
||||||
private final HexagonTile[][] grid;
|
private final HexagonTile[][] grid;
|
||||||
private int tileCount;
|
|
||||||
private int tileWidth, tileHeight, padding;
|
private int tileWidth, tileHeight, padding;
|
||||||
|
|
||||||
public ConquestPlaneMap(ConquestPlane plane) {
|
public ConquestPlaneMap(ConquestPlane plane) {
|
||||||
@@ -103,7 +102,6 @@ public class ConquestPlaneMap {
|
|||||||
|
|
||||||
private void generateRandomGrid(ConquestPlane plane) {
|
private void generateRandomGrid(ConquestPlane plane) {
|
||||||
int center = gridSize / 2; //player will start at center of grid always
|
int center = gridSize / 2; //player will start at center of grid always
|
||||||
addTile(center, center, null);
|
|
||||||
|
|
||||||
//divide the grid into regions
|
//divide the grid into regions
|
||||||
FCollectionView<Region> regions = plane.getRegions();
|
FCollectionView<Region> regions = plane.getRegions();
|
||||||
@@ -131,20 +129,11 @@ public class ConquestPlaneMap {
|
|||||||
if (regionIndex >= regionCount) {
|
if (regionIndex >= regionCount) {
|
||||||
regionIndex = 0;
|
regionIndex = 0;
|
||||||
}
|
}
|
||||||
addTile(q, r, regions.get(regionIndex));
|
grid[q][r] = new HexagonTile(q, r, regions.get(regionIndex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean addTile(int q, int r, Region region) {
|
|
||||||
if (grid[q][r] == null) {
|
|
||||||
grid[q][r] = new HexagonTile(q, r, region);
|
|
||||||
tileCount++;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class HexagonTile {
|
public class HexagonTile {
|
||||||
private final int q, r;
|
private final int q, r;
|
||||||
private final Region region;
|
private final Region region;
|
||||||
|
|||||||
Reference in New Issue
Block a user