mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-28 00:10:48 -07:00
Many various internal changes
This commit is contained in:
parent
36ec88e2e2
commit
de5979f4ee
53 changed files with 435 additions and 575 deletions
|
|
@ -106,8 +106,8 @@ public class ApplicationTests{
|
|||
Time.update();
|
||||
Time.update();
|
||||
Time.setDeltaProvider(() -> 1f);
|
||||
unitGroups[(int) waveTeam.id].updateEvents();
|
||||
assertFalse(unitGroups[(int) waveTeam.id].isEmpty(), "No enemies spawned.");
|
||||
unitGroup.update();
|
||||
assertFalse(unitGroup.isEmpty(), "No enemies spawned.");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -128,7 +128,7 @@ public class ApplicationTests{
|
|||
createMap();
|
||||
int bx = 4;
|
||||
int by = 4;
|
||||
world.setBlock(world.tile(bx, by), Blocks.coreShard, Team.sharded);
|
||||
world.tile(bx, by).set(Blocks.coreShard, Team.sharded);
|
||||
assertEquals(world.tile(bx, by).getTeam(), Team.sharded);
|
||||
for(int x = bx - 1; x <= bx + 1; x++){
|
||||
for(int y = by - 1; y <= by + 1; y++){
|
||||
|
|
@ -198,7 +198,7 @@ public class ApplicationTests{
|
|||
@Test
|
||||
void save(){
|
||||
world.loadMap(testMap);
|
||||
assertTrue(state.teams.get(defaultTeam).cores.size > 0);
|
||||
assertTrue(state.teams.playerCores().size > 0);
|
||||
SaveIO.save(saveDirectory.child("0.msav"));
|
||||
}
|
||||
|
||||
|
|
@ -213,7 +213,7 @@ public class ApplicationTests{
|
|||
|
||||
assertEquals(world.width(), map.width);
|
||||
assertEquals(world.height(), map.height);
|
||||
assertTrue(state.teams.get(defaultTeam).cores.size > 0);
|
||||
assertTrue(state.teams.playerCores().size > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -379,12 +379,12 @@ public class ApplicationTests{
|
|||
createMap();
|
||||
|
||||
Tile core = world.tile(5, 5);
|
||||
world.setBlock(core, Blocks.coreShard, Team.sharded);
|
||||
core.set(Blocks.coreShard, Team.sharded);
|
||||
for(Item item : content.items()){
|
||||
core.entity.items.set(item, 3000);
|
||||
}
|
||||
|
||||
assertEquals(core, state.teams.get(Team.sharded).cores.first());
|
||||
assertEquals(core.entity, state.teams.get(Team.sharded).core());
|
||||
}
|
||||
|
||||
void depositTest(Block block, Item item){
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class ZoneTests{
|
|||
if(tile.drop() != null){
|
||||
resources.add(tile.drop());
|
||||
}
|
||||
if(tile.block() instanceof CoreBlock && tile.getTeam() == defaultTeam){
|
||||
if(tile.block() instanceof CoreBlock && tile.getTeam() == state.rules.defaultTeam){
|
||||
hasSpawnPoint = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ public class ZoneTests{
|
|||
}
|
||||
|
||||
assertTrue(hasSpawnPoint, "Zone \"" + zone.name + "\" has no spawn points.");
|
||||
assertTrue(spawner.countSpawns() > 0 || (state.rules.attackMode && !state.teams.get(waveTeam).cores.isEmpty()), "Zone \"" + zone.name + "\" has no enemy spawn points: " + spawner.countSpawns());
|
||||
assertTrue(spawner.countSpawns() > 0 || (state.rules.attackMode && state.teams.get(state.rules.waveTeam).hasCore()), "Zone \"" + zone.name + "\" has no enemy spawn points: " + spawner.countSpawns());
|
||||
|
||||
for(Item item : resources){
|
||||
assertTrue(zone.resources.contains(item), "Zone \"" + zone.name + "\" is missing item in resource list: \"" + item.name + "\"");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue