mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 14:57:18 +07:00
Fixed unit tests / Fixed zones having incorrect waves
This commit is contained in:
@ -1,7 +1,8 @@
|
|||||||
package io.anuke.mindustry.content;
|
package io.anuke.mindustry.content;
|
||||||
|
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.ContentList;
|
||||||
|
import io.anuke.mindustry.game.SpawnGroup;
|
||||||
import io.anuke.mindustry.maps.generators.MapGenerator;
|
import io.anuke.mindustry.maps.generators.MapGenerator;
|
||||||
import io.anuke.mindustry.maps.generators.MapGenerator.Decoration;
|
import io.anuke.mindustry.maps.generators.MapGenerator.Decoration;
|
||||||
import io.anuke.mindustry.maps.zonegen.DesertWastesGenerator;
|
import io.anuke.mindustry.maps.zonegen.DesertWastesGenerator;
|
||||||
@ -25,11 +26,11 @@ public class Zones implements ContentList{
|
|||||||
conditionWave = 5;
|
conditionWave = 5;
|
||||||
launchPeriod = 5;
|
launchPeriod = 5;
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.sand};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 2;
|
r.waveSpacing = 60 * 60 * 2;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
desertWastes = new Zone("desertWastes", new DesertWastesGenerator(260, 260)){{
|
desertWastes = new Zone("desertWastes", new DesertWastesGenerator(260, 260)){{
|
||||||
@ -39,12 +40,12 @@ public class Zones implements ContentList{
|
|||||||
loadout = Loadouts.advancedShard;
|
loadout = Loadouts.advancedShard;
|
||||||
zoneRequirements = ZoneRequirement.with(groundZero, 20);
|
zoneRequirements = ZoneRequirement.with(groundZero, 20);
|
||||||
resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.sand};
|
resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
launchWaveMultiplier = 3f;
|
r.launchWaveMultiplier = 3f;
|
||||||
waveSpacing = 60 * 50f;
|
r.waveSpacing = 60 * 50f;
|
||||||
spawns = Array.with(
|
r.spawns = Array.with(
|
||||||
new SpawnGroup(UnitTypes.crawler){{
|
new SpawnGroup(UnitTypes.crawler){{
|
||||||
unitScaling = 3f;
|
unitScaling = 3f;
|
||||||
}},
|
}},
|
||||||
@ -77,7 +78,7 @@ public class Zones implements ContentList{
|
|||||||
spacing = 20;
|
spacing = 20;
|
||||||
}}
|
}}
|
||||||
);
|
);
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
saltFlats = new Zone("saltFlats", new MapGenerator("saltFlats")){{
|
saltFlats = new Zone("saltFlats", new MapGenerator("saltFlats")){{
|
||||||
@ -88,15 +89,15 @@ public class Zones implements ContentList{
|
|||||||
launchPeriod = 5;
|
launchPeriod = 5;
|
||||||
zoneRequirements = ZoneRequirement.with(desertWastes, 60);
|
zoneRequirements = ZoneRequirement.with(desertWastes, 60);
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
attackMode = true;
|
r.attackMode = true;
|
||||||
waveSpacing = 60 * 60;
|
r.waveSpacing = 60 * 60;
|
||||||
buildCostMultiplier = 0.5f;
|
r.buildCostMultiplier = 0.5f;
|
||||||
unitBuildSpeedMultiplier = 0.5f;
|
r.unitBuildSpeedMultiplier = 0.5f;
|
||||||
enemyCheat = true;
|
r.enemyCheat = true;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
craters = new Zone("craters", new MapGenerator("craters", 1).dist(0).decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.01))){{
|
craters = new Zone("craters", new MapGenerator("craters", 1).dist(0).decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.01))){{
|
||||||
@ -105,11 +106,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(groundZero, 10);
|
zoneRequirements = ZoneRequirement.with(groundZero, 10);
|
||||||
blockRequirements = new Block[]{Blocks.router};
|
blockRequirements = new Block[]{Blocks.router};
|
||||||
resources = new Item[]{Items.copper, Items.lead, Items.coal};
|
resources = new Item[]{Items.copper, Items.lead, Items.coal};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 1.5f;
|
r.waveSpacing = 60 * 60 * 1.5f;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 1)
|
frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 1)
|
||||||
@ -120,11 +121,11 @@ public class Zones implements ContentList{
|
|||||||
conditionWave = 10;
|
conditionWave = 10;
|
||||||
zoneRequirements = ZoneRequirement.with(craters, 10);
|
zoneRequirements = ZoneRequirement.with(craters, 10);
|
||||||
resources = new Item[]{Items.copper, Items.lead, Items.coal};
|
resources = new Item[]{Items.copper, Items.lead, Items.coal};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 1.5f;
|
r.waveSpacing = 60 * 60 * 1.5f;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
overgrowth = new Zone("overgrowth", new MapGenerator("overgrowth")){{
|
overgrowth = new Zone("overgrowth", new MapGenerator("overgrowth")){{
|
||||||
@ -135,11 +136,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(frozenForest, 40);
|
zoneRequirements = ZoneRequirement.with(frozenForest, 40);
|
||||||
blockRequirements = new Block[]{Blocks.router};
|
blockRequirements = new Block[]{Blocks.router};
|
||||||
resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.titanium, Items.sand, Items.thorium, Items.scrap};
|
resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.titanium, Items.sand, Items.thorium, Items.scrap};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 100f;
|
r.waveSpacing = 60 * 100f;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
ruinousShores = new Zone("ruinousShores", new MapGenerator("ruinousShores", 1).dist(3f, true)){{
|
ruinousShores = new Zone("ruinousShores", new MapGenerator("ruinousShores", 1).dist(3f, true)){{
|
||||||
@ -151,11 +152,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(desertWastes, 20, craters, 15);
|
zoneRequirements = ZoneRequirement.with(desertWastes, 20, craters, 15);
|
||||||
blockRequirements = new Block[]{Blocks.graphitePress, Blocks.combustionGenerator};
|
blockRequirements = new Block[]{Blocks.graphitePress, Blocks.combustionGenerator};
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 80;
|
r.waveSpacing = 60 * 80;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
stainedMountains = new Zone("stainedMountains", new MapGenerator("stainedMountains", 2)
|
stainedMountains = new Zone("stainedMountains", new MapGenerator("stainedMountains", 2)
|
||||||
@ -168,11 +169,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(frozenForest, 15);
|
zoneRequirements = ZoneRequirement.with(frozenForest, 15);
|
||||||
blockRequirements = new Block[]{Blocks.pneumaticDrill};
|
blockRequirements = new Block[]{Blocks.pneumaticDrill};
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 2;
|
r.waveSpacing = 60 * 60 * 2;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
tarFields = new Zone("tarFields", new MapGenerator("tarFields")
|
tarFields = new Zone("tarFields", new MapGenerator("tarFields")
|
||||||
@ -185,11 +186,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(ruinousShores, 20);
|
zoneRequirements = ZoneRequirement.with(ruinousShores, 20);
|
||||||
blockRequirements = new Block[]{Blocks.coalCentrifuge};
|
blockRequirements = new Block[]{Blocks.coalCentrifuge};
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 2;
|
r.waveSpacing = 60 * 60 * 2;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
desolateRift = new Zone("desolateRift", new MapGenerator("desolateRift").dist(2f)){{
|
desolateRift = new Zone("desolateRift", new MapGenerator("desolateRift").dist(2f)){{
|
||||||
@ -201,11 +202,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(tarFields, 20);
|
zoneRequirements = ZoneRequirement.with(tarFields, 20);
|
||||||
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand, Items.thorium};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand, Items.thorium};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 2.5f;
|
r.waveSpacing = 60 * 60 * 2.5f;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
nuclearComplex = new Zone("nuclearComplex", new MapGenerator("nuclearProductionComplex", 1)
|
nuclearComplex = new Zone("nuclearComplex", new MapGenerator("nuclearProductionComplex", 1)
|
||||||
@ -218,11 +219,11 @@ public class Zones implements ContentList{
|
|||||||
zoneRequirements = ZoneRequirement.with(stainedMountains, 20);
|
zoneRequirements = ZoneRequirement.with(stainedMountains, 20);
|
||||||
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
||||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.thorium, Items.sand};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.thorium, Items.sand};
|
||||||
rules = () -> new Rules(){{
|
rules = r -> {
|
||||||
waves = true;
|
r.waves = true;
|
||||||
waveTimer = true;
|
r.waveTimer = true;
|
||||||
waveSpacing = 60 * 60 * 2;
|
r.waveSpacing = 60 * 60 * 2;
|
||||||
}};
|
};
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ public class Control implements ApplicationListener{
|
|||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
logic.reset();
|
logic.reset();
|
||||||
world.loadGenerator(zone.generator);
|
world.loadGenerator(zone.generator);
|
||||||
state.rules = zone.rules.get();
|
zone.rules.accept(state.rules);
|
||||||
state.rules.zone = zone;
|
state.rules.zone = zone;
|
||||||
for(Tile core : state.teams.get(defaultTeam).cores){
|
for(Tile core : state.teams.get(defaultTeam).cores){
|
||||||
for(ItemStack stack : zone.getStartingItems()){
|
for(ItemStack stack : zone.getStartingItems()){
|
||||||
|
@ -4,7 +4,6 @@ import io.anuke.arc.Core;
|
|||||||
import io.anuke.arc.Events;
|
import io.anuke.arc.Events;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.Array;
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.function.Consumer;
|
||||||
import io.anuke.arc.function.Supplier;
|
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.arc.util.Structs;
|
import io.anuke.arc.util.Structs;
|
||||||
@ -25,7 +24,7 @@ public class Zone extends UnlockableContent{
|
|||||||
public Block[] blockRequirements = {};
|
public Block[] blockRequirements = {};
|
||||||
public ZoneRequirement[] zoneRequirements = {};
|
public ZoneRequirement[] zoneRequirements = {};
|
||||||
public Item[] resources = {};
|
public Item[] resources = {};
|
||||||
public Supplier<Rules> rules = Rules::new;
|
public Consumer<Rules> rules = rules -> {};
|
||||||
public boolean alwaysUnlocked;
|
public boolean alwaysUnlocked;
|
||||||
public int conditionWave = Integer.MAX_VALUE;
|
public int conditionWave = Integer.MAX_VALUE;
|
||||||
public int configureWave = 15;
|
public int configureWave = 15;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import io.anuke.arc.*;
|
import io.anuke.arc.ApplicationCore;
|
||||||
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.backends.headless.HeadlessApplication;
|
import io.anuke.arc.backends.headless.HeadlessApplication;
|
||||||
import io.anuke.arc.collection.Array;
|
|
||||||
import io.anuke.arc.math.geom.Point2;
|
import io.anuke.arc.math.geom.Point2;
|
||||||
import io.anuke.arc.util.Log;
|
import io.anuke.arc.util.Log;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
@ -11,11 +11,13 @@ import io.anuke.mindustry.core.*;
|
|||||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||||
import io.anuke.mindustry.entities.type.BaseUnit;
|
import io.anuke.mindustry.entities.type.BaseUnit;
|
||||||
import io.anuke.mindustry.entities.type.base.Spirit;
|
import io.anuke.mindustry.entities.type.base.Spirit;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.Content;
|
||||||
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.io.BundleLoader;
|
import io.anuke.mindustry.io.BundleLoader;
|
||||||
import io.anuke.mindustry.io.SaveIO;
|
import io.anuke.mindustry.io.SaveIO;
|
||||||
import io.anuke.mindustry.maps.Map;
|
import io.anuke.mindustry.maps.Map;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.ContentType;
|
||||||
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.blocks.BlockPart;
|
import io.anuke.mindustry.world.blocks.BlockPart;
|
||||||
import org.junit.jupiter.api.*;
|
import org.junit.jupiter.api.*;
|
||||||
@ -266,39 +268,6 @@ public class ApplicationTests{
|
|||||||
assertTrue(world.tile(1, 1).block() instanceof BlockPart);
|
assertTrue(world.tile(1, 1).block() instanceof BlockPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
void zoneEmptyWaves(){
|
|
||||||
for(Zone zone : content.zones()){
|
|
||||||
Array<SpawnGroup> spawns = zone.rules.get().spawns;
|
|
||||||
for(int i = 1; i <= 100; i++){
|
|
||||||
int total = 0;
|
|
||||||
for(SpawnGroup spawn : spawns){
|
|
||||||
total += spawn.getUnitsSpawned(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
assertNotEquals(0, total, "Zone " + zone + " has no spawned enemies at wave " + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void zoneOverflowWaves(){
|
|
||||||
for(Zone zone : content.zones()){
|
|
||||||
Array<SpawnGroup> spawns = zone.rules.get().spawns;
|
|
||||||
|
|
||||||
for(int i = 1; i <= 40; i++){
|
|
||||||
int total = 0;
|
|
||||||
for(SpawnGroup spawn : spawns){
|
|
||||||
total += spawn.getUnitsSpawned(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(total >= 140){
|
|
||||||
fail("Zone '" + zone + "' has too many spawned enemies at wave " + i + " : " + total);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void buildingDestruction(){
|
void buildingDestruction(){
|
||||||
initBuilding();
|
initBuilding();
|
||||||
|
@ -3,6 +3,7 @@ import io.anuke.arc.collection.ObjectSet;
|
|||||||
import io.anuke.arc.util.Structs;
|
import io.anuke.arc.util.Structs;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
|
import io.anuke.mindustry.game.SpawnGroup;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Zone;
|
import io.anuke.mindustry.type.Zone;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
@ -10,6 +11,7 @@ import io.anuke.mindustry.world.blocks.storage.CoreBlock;
|
|||||||
import org.junit.jupiter.api.*;
|
import org.junit.jupiter.api.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
|
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
|
||||||
|
|
||||||
@ -28,7 +30,7 @@ public class ZoneTests{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TestFactory
|
@TestFactory
|
||||||
DynamicTest[] testZoneResources(){
|
DynamicTest[] testZoneValidity(){
|
||||||
Array<DynamicTest> out = new Array<>();
|
Array<DynamicTest> out = new Array<>();
|
||||||
|
|
||||||
for(Zone zone : content.zones()){
|
for(Zone zone : content.zones()){
|
||||||
@ -36,6 +38,7 @@ public class ZoneTests{
|
|||||||
zone.generator.init(zone.loadout);
|
zone.generator.init(zone.loadout);
|
||||||
logic.reset();
|
logic.reset();
|
||||||
world.loadGenerator(zone.generator);
|
world.loadGenerator(zone.generator);
|
||||||
|
zone.rules.accept(state.rules);
|
||||||
ObjectSet<Item> resources = new ObjectSet<>();
|
ObjectSet<Item> resources = new ObjectSet<>();
|
||||||
boolean hasSpawnPoint = false;
|
boolean hasSpawnPoint = false;
|
||||||
|
|
||||||
@ -51,15 +54,25 @@ public class ZoneTests{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Array<SpawnGroup> spawns = state.rules.spawns;
|
||||||
|
for(int i = 1; i <= 100; i++){
|
||||||
|
int total = 0;
|
||||||
|
for(SpawnGroup spawn : spawns){
|
||||||
|
total += spawn.getUnitsSpawned(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
assertNotEquals(0, total, "Zone " + zone + " has no spawned enemies at wave " + i);
|
||||||
|
}
|
||||||
|
|
||||||
assertTrue(hasSpawnPoint, "Zone \"" + zone.name + "\" has no spawn points.");
|
assertTrue(hasSpawnPoint, "Zone \"" + zone.name + "\" has no spawn points.");
|
||||||
assertTrue(world.spawner.countSpawns() > 0 || (zone.rules.get().attackMode && !state.teams.get(waveTeam).cores.isEmpty()), "Zone \"" + zone.name + "\" has no enemy spawn points: " + world.spawner.countSpawns());
|
assertTrue(world.spawner.countSpawns() > 0 || (state.rules.attackMode && !state.teams.get(waveTeam).cores.isEmpty()), "Zone \"" + zone.name + "\" has no enemy spawn points: " + world.spawner.countSpawns());
|
||||||
|
|
||||||
for(Item item : resources){
|
for(Item item : resources){
|
||||||
assertTrue(Structs.contains(zone.resources, item), "Zone \"" + zone.name + "\" is missing item in resource list: \"" + item.name + "\"");
|
assertTrue(Structs.contains(zone.resources, item), "Zone \"" + zone.name + "\" is missing item in resource list: \"" + item.name + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Item item : zone.resources){
|
for(Item item : zone.resources){
|
||||||
assertTrue(resources.contains(item), "Zone \"" + zone.name + "\" has unnecessary item in resoruce list: \"" + item.name + "\"");
|
assertTrue(resources.contains(item), "Zone \"" + zone.name + "\" has unnecessary item in resource list: \"" + item.name + "\"");
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user