Testing loading of old saves

This commit is contained in:
Anuken 2019-06-12 15:29:41 -04:00
parent 0aee75c1c1
commit 62bd0442df
2 changed files with 34 additions and 25 deletions

View File

@ -34,6 +34,30 @@ public class UnitTypes implements ContentList{
}};
}};
phantom = new UnitType("phantom", Phantom.class, Phantom::new){{
isFlying = true;
drag = 0.01f;
mass = 2f;
speed = 0.45f;
maxVelocity = 1.9f;
range = 70f;
itemCapacity = 70;
health = 220;
buildPower = 0.9f;
minePower = 1.1f;
engineOffset = 6.5f;
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
weapon = new Weapon("heal-blaster"){{
length = 1.5f;
reload = 20f;
width = 0.5f;
roundrobin = true;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBullet;
}};
}};
dagger = new UnitType("dagger", Dagger.class, Dagger::new){{
maxVelocity = 1.1f;
speed = 0.2f;
@ -213,30 +237,6 @@ public class UnitTypes implements ContentList{
}};
}};
phantom = new UnitType("phantom", Phantom.class, Phantom::new){{
isFlying = true;
drag = 0.01f;
mass = 2f;
speed = 0.45f;
maxVelocity = 1.9f;
range = 70f;
itemCapacity = 70;
health = 220;
buildPower = 0.9f;
minePower = 1.1f;
engineOffset = 6.5f;
toMine = ObjectSet.with(Items.lead, Items.copper, Items.titanium);
weapon = new Weapon("heal-blaster"){{
length = 1.5f;
reload = 20f;
width = 0.5f;
roundrobin = true;
ejectEffect = Fx.none;
recoil = 2f;
bullet = Bullets.healBullet;
}};
}};
revenant = new UnitType("revenant", Revenant.class, Revenant::new){{
health = 1000;
mass = 5f;

View File

@ -1,4 +1,4 @@
import io.anuke.arc.ApplicationCore;
import io.anuke.arc.*;
import io.anuke.arc.backends.headless.HeadlessApplication;
import io.anuke.arc.collection.Array;
import io.anuke.arc.math.geom.Point2;
@ -215,6 +215,15 @@ public class ApplicationTests{
assertTrue(state.teams.get(defaultTeam).cores.size > 0);
}
@Test
void loadOldSave(){
resetWorld();
SaveIO.load(Core.files.internal("build77.msav"));
assertEquals(50, world.width());
assertEquals(50, world.height());
}
@Test
void inventoryDeposit(){
depositTest(Blocks.surgeSmelter, Items.copper);