mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 04:13:44 +07:00
Fixed refactoring errors
This commit is contained in:
parent
0dd9d2b460
commit
67940476af
@ -2,7 +2,3 @@ apply plugin: "java"
|
||||
sourceCompatibility = 1.8
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
sourceSets.main.java.srcDirs = ["src/"]
|
||||
|
||||
compileJava{
|
||||
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
package io.anuke.mindustry.content;
|
||||
|
||||
import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.mindustry.entities.type.types.Crawler;
|
||||
import io.anuke.mindustry.type.UnitType;
|
||||
import io.anuke.mindustry.entities.type.base.*;
|
||||
import io.anuke.mindustry.game.ContentList;
|
||||
import io.anuke.mindustry.type.UnitType;
|
||||
|
||||
public class UnitTypes implements ContentList{
|
||||
public static UnitType
|
||||
@ -13,7 +13,7 @@ public class UnitTypes implements ContentList{
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
spirit = new UnitType("spirit", io.anuke.mindustry.entities.type.types.Spirit.class, io.anuke.mindustry.entities.type.types.Spirit::new){{
|
||||
spirit = new UnitType("spirit", Spirit.class, Spirit::new){{
|
||||
weapon = Weapons.healBlasterDrone;
|
||||
isFlying = true;
|
||||
drag = 0.01f;
|
||||
@ -23,7 +23,7 @@ public class UnitTypes implements ContentList{
|
||||
health = 60;
|
||||
}};
|
||||
|
||||
dagger = new UnitType("dagger", io.anuke.mindustry.entities.type.types.Dagger.class, io.anuke.mindustry.entities.type.types.Dagger::new){{
|
||||
dagger = new UnitType("dagger", Dagger.class, Dagger::new){{
|
||||
maxVelocity = 1.1f;
|
||||
speed = 0.2f;
|
||||
drag = 0.4f;
|
||||
@ -33,7 +33,7 @@ public class UnitTypes implements ContentList{
|
||||
health = 130;
|
||||
}};
|
||||
|
||||
crawler = new UnitType("crawler", io.anuke.mindustry.entities.type.types.Crawler.class, Crawler::new){{
|
||||
crawler = new UnitType("crawler", Crawler.class, Crawler::new){{
|
||||
maxVelocity = 1.1f;
|
||||
speed = 0.22f;
|
||||
drag = 0.4f;
|
||||
@ -43,7 +43,7 @@ public class UnitTypes implements ContentList{
|
||||
health = 100;
|
||||
}};
|
||||
|
||||
titan = new UnitType("titan", io.anuke.mindustry.entities.type.types.Titan.class, io.anuke.mindustry.entities.type.types.Titan::new){{
|
||||
titan = new UnitType("titan", Titan.class, Titan::new){{
|
||||
maxVelocity = 0.8f;
|
||||
speed = 0.18f;
|
||||
drag = 0.4f;
|
||||
@ -55,7 +55,7 @@ public class UnitTypes implements ContentList{
|
||||
immunities.add(StatusEffects.burning);
|
||||
}};
|
||||
|
||||
fortress = new UnitType("fortress", io.anuke.mindustry.entities.type.types.Fortress.class, io.anuke.mindustry.entities.type.types.Fortress::new){{
|
||||
fortress = new UnitType("fortress", Fortress.class, Fortress::new){{
|
||||
maxVelocity = 0.78f;
|
||||
speed = 0.15f;
|
||||
drag = 0.4f;
|
||||
@ -68,7 +68,7 @@ public class UnitTypes implements ContentList{
|
||||
health = 800;
|
||||
}};
|
||||
|
||||
eruptor = new UnitType("eruptor", io.anuke.mindustry.entities.type.types.Eruptor.class, io.anuke.mindustry.entities.type.types.Eruptor::new){{
|
||||
eruptor = new UnitType("eruptor", Eruptor.class, Eruptor::new){{
|
||||
maxVelocity = 0.81f;
|
||||
speed = 0.16f;
|
||||
drag = 0.4f;
|
||||
@ -82,7 +82,7 @@ public class UnitTypes implements ContentList{
|
||||
immunities = ObjectSet.with(StatusEffects.burning, StatusEffects.melting);
|
||||
}};
|
||||
|
||||
wraith = new UnitType("wraith", io.anuke.mindustry.entities.type.types.Wraith.class, io.anuke.mindustry.entities.type.types.Wraith::new){{
|
||||
wraith = new UnitType("wraith", Wraith.class, Wraith::new){{
|
||||
speed = 0.3f;
|
||||
maxVelocity = 1.9f;
|
||||
drag = 0.01f;
|
||||
@ -92,7 +92,7 @@ public class UnitTypes implements ContentList{
|
||||
health = 70;
|
||||
}};
|
||||
|
||||
ghoul = new UnitType("ghoul", io.anuke.mindustry.entities.type.types.Ghoul.class, io.anuke.mindustry.entities.type.types.Ghoul::new){{
|
||||
ghoul = new UnitType("ghoul", Ghoul.class, Ghoul::new){{
|
||||
health = 250;
|
||||
speed = 0.2f;
|
||||
maxVelocity = 1.4f;
|
||||
@ -103,7 +103,7 @@ public class UnitTypes implements ContentList{
|
||||
weapon = Weapons.bomber;
|
||||
}};
|
||||
|
||||
revenant = new UnitType("revenant", io.anuke.mindustry.entities.type.types.Revenant.class, io.anuke.mindustry.entities.type.types.Revenant::new){{
|
||||
revenant = new UnitType("revenant", Revenant.class, Revenant::new){{
|
||||
health = 250;
|
||||
mass = 5f;
|
||||
hitsize = 12f;
|
||||
@ -115,7 +115,7 @@ public class UnitTypes implements ContentList{
|
||||
weapon = Weapons.laserBurster;
|
||||
}};
|
||||
|
||||
phantom = new UnitType("phantom", io.anuke.mindustry.entities.type.types.Phantom.class, io.anuke.mindustry.entities.type.types.Phantom::new){{
|
||||
phantom = new UnitType("phantom", Phantom.class, Phantom::new){{
|
||||
weapon = Weapons.healBlasterDrone2;
|
||||
isFlying = true;
|
||||
drag = 0.01f;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.GroundUnit;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.GroundUnit;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.arc.Events;
|
||||
import io.anuke.arc.collection.Queue;
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.GroundUnit;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.type.GroundUnit;
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.FlyingUnit;
|
||||
|
@ -0,0 +1,5 @@
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
public class Phantom extends Drone{
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.FlyingUnit;
|
||||
|
@ -0,0 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
public class Spirit extends Drone{
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.GroundUnit;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
package io.anuke.mindustry.entities.type.base;
|
||||
|
||||
import io.anuke.mindustry.entities.type.FlyingUnit;
|
||||
|
@ -1,5 +0,0 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
|
||||
public class Phantom extends Drone{
|
||||
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package io.anuke.mindustry.entities.type.types;
|
||||
|
||||
public class Spirit extends Drone{
|
||||
}
|
@ -16,7 +16,7 @@ import io.anuke.mindustry.game.UnlockableContent;
|
||||
import io.anuke.mindustry.ui.ContentDisplay;
|
||||
|
||||
public class UnitType extends UnlockableContent{
|
||||
protected final Supplier<? extends io.anuke.mindustry.entities.type.BaseUnit> constructor;
|
||||
protected final Supplier<? extends BaseUnit> constructor;
|
||||
|
||||
public final String name;
|
||||
public final String description;
|
||||
@ -42,7 +42,7 @@ public class UnitType extends UnlockableContent{
|
||||
|
||||
public TextureRegion iconRegion, legRegion, baseRegion, region;
|
||||
|
||||
public <T extends io.anuke.mindustry.entities.type.BaseUnit> UnitType(String name, Class<T> type, Supplier<T> mainConstructor){
|
||||
public <T extends BaseUnit> UnitType(String name, Class<T> type, Supplier<T> mainConstructor){
|
||||
this.name = name;
|
||||
this.constructor = mainConstructor;
|
||||
this.description = Core.bundle.getOrNull("unit." + name + ".description");
|
||||
@ -91,7 +91,7 @@ public class UnitType extends UnlockableContent{
|
||||
return name;
|
||||
}
|
||||
|
||||
public io.anuke.mindustry.entities.type.BaseUnit create(Team team){
|
||||
public BaseUnit create(Team team){
|
||||
BaseUnit unit = constructor.get();
|
||||
unit.init(this, team);
|
||||
return unit;
|
||||
|
@ -14,7 +14,7 @@ import io.anuke.mindustry.core.NetServer;
|
||||
import io.anuke.mindustry.core.World;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||
import io.anuke.mindustry.entities.type.BaseUnit;
|
||||
import io.anuke.mindustry.entities.type.types.Spirit;
|
||||
import io.anuke.mindustry.entities.type.base.Spirit;
|
||||
import io.anuke.mindustry.game.Content;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.io.BundleLoader;
|
||||
@ -231,8 +231,8 @@ public class ApplicationTests{
|
||||
d2.addBuildRequest(new BuildRequest(1, 1, 0, Blocks.copperWallLarge));
|
||||
|
||||
Time.setDeltaProvider(() -> 9999999f);
|
||||
d1.updateBuilding(d1);
|
||||
d2.updateBuilding(d2);
|
||||
d1.updateBuilding();
|
||||
d2.updateBuilding();
|
||||
|
||||
assertEquals(Blocks.copperWallLarge, world.tile(0, 0).block());
|
||||
assertEquals(Blocks.air, world.tile(2, 2).block());
|
||||
@ -253,16 +253,16 @@ public class ApplicationTests{
|
||||
d2.addBuildRequest(new BuildRequest(1, 1));
|
||||
|
||||
Time.setDeltaProvider(() -> 3f);
|
||||
d1.updateBuilding(d1);
|
||||
d1.updateBuilding();
|
||||
Time.setDeltaProvider(() -> 1f);
|
||||
d2.updateBuilding(d2);
|
||||
d2.updateBuilding();
|
||||
|
||||
assertEquals(content.getByName(ContentType.block, "build2"), world.tile(0, 0).block());
|
||||
|
||||
Time.setDeltaProvider(() -> 9999f);
|
||||
|
||||
d1.updateBuilding(d1);
|
||||
d2.updateBuilding(d2);
|
||||
d1.updateBuilding();
|
||||
d2.updateBuilding();
|
||||
|
||||
assertEquals(Blocks.air, world.tile(0, 0).block());
|
||||
assertEquals(Blocks.air, world.tile(2, 2).block());
|
||||
|
Loading…
Reference in New Issue
Block a user