Cleanup
This commit is contained in:
@@ -6,6 +6,7 @@ import arc.math.*;
|
|||||||
import arc.math.geom.*;
|
import arc.math.geom.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -38,19 +39,15 @@ public class Effects{
|
|||||||
Rect pos = Tmp.r2.setSize(effect.size).setCenter(x, y);
|
Rect pos = Tmp.r2.setSize(effect.size).setCenter(x, y);
|
||||||
|
|
||||||
if(view.overlaps(pos)){
|
if(view.overlaps(pos)){
|
||||||
//TODO implement create() method here.
|
EffectEntity entity = EffectEntity.create();
|
||||||
//EffectEntity entity = Pools.obtain(EffectEntity.class, EffectEntity::new);
|
entity.effect(effect);
|
||||||
//entity.effect = effect;
|
entity.rotation(rotation);
|
||||||
//entity.color.set(color);
|
entity.data(data);
|
||||||
//entity.rotation = rotation;
|
entity.id(EntityGroup.nextId());
|
||||||
//entity.data = data;
|
entity.set(x, y);
|
||||||
//entity.id++;
|
entity.color().set(color);
|
||||||
//entity.set(x, y);
|
if(data instanceof Posc) entity.parent((Posc)data);
|
||||||
//if(data instanceof Entity){
|
entity.add();
|
||||||
// entity.setParent((Entity)data);
|
|
||||||
//}
|
|
||||||
//TODO ground effect
|
|
||||||
//effectGroup.add(entity);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class AllEntities{
|
|||||||
@EntityDef(value = {Tilec.class}, isFinal = false)
|
@EntityDef(value = {Tilec.class}, isFinal = false)
|
||||||
class TileDef{}
|
class TileDef{}
|
||||||
|
|
||||||
@EntityDef(value = {Effectc.class}, pooled = true)
|
@EntityDef(value = {Effectc.class, Childc.class}, pooled = true)
|
||||||
class EffectDef{}
|
class EffectDef{}
|
||||||
|
|
||||||
@EntityDef({Decalc.class})
|
@EntityDef({Decalc.class})
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import mindustry.gen.*;
|
|||||||
abstract class ChildComp implements Posc{
|
abstract class ChildComp implements Posc{
|
||||||
transient float x, y;
|
transient float x, y;
|
||||||
|
|
||||||
private @Nullable Posc parent;
|
@Nullable Posc parent;
|
||||||
private float offsetX, offsetY;
|
float offsetX, offsetY;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(){
|
public void add(){
|
||||||
|
|||||||
@@ -78,11 +78,6 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Unitc unit(){
|
public Unitc unit(){
|
||||||
if(dead()){
|
|
||||||
//TODO remove
|
|
||||||
Log.err("WARNING: DEAD PLAYER UNIT ACCESSED");
|
|
||||||
new RuntimeException().printStackTrace();
|
|
||||||
}
|
|
||||||
return unit;
|
return unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,20 +58,17 @@ public class SpawnGroup implements Serializable{
|
|||||||
* This method does not add() the unit.
|
* This method does not add() the unit.
|
||||||
*/
|
*/
|
||||||
public Unitc createUnit(Team team){
|
public Unitc createUnit(Team team){
|
||||||
//TODO
|
|
||||||
throw new IllegalArgumentException("TODO");
|
|
||||||
/*
|
|
||||||
Unitc unit = type.create(team);
|
Unitc unit = type.create(team);
|
||||||
|
|
||||||
if(effect != null){
|
if(effect != null){
|
||||||
unit.applyEffect(effect, 999999f);
|
unit.apply(effect, 999999f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(items != null){
|
if(items != null){
|
||||||
unit.addItem(items.item, items.amount);
|
unit.addItem(items.item, items.amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
return unit;*/
|
return unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import java.util.zip.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
/** Reads and writes map files. */
|
/** Reads and writes map files. */
|
||||||
//TODO does this class even need to exist??? move to Maps?
|
|
||||||
public class MapIO{
|
public class MapIO{
|
||||||
private static final int[] pngHeader = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A};
|
private static final int[] pngHeader = {0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A};
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import arc.util.*;
|
|||||||
import mindustry.graphics.PlanetGrid.*;
|
import mindustry.graphics.PlanetGrid.*;
|
||||||
|
|
||||||
/** A small section of a planet. */
|
/** A small section of a planet. */
|
||||||
//TODO should this be content?
|
|
||||||
public class Sector{
|
public class Sector{
|
||||||
public final SectorRect rect;
|
public final SectorRect rect;
|
||||||
public final Planet planet;
|
public final Planet planet;
|
||||||
|
|||||||
@@ -131,56 +131,6 @@ public class ContentDisplay{
|
|||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO implement later
|
|
||||||
/*
|
|
||||||
public static void displayMech(Table table, Mech mech){
|
|
||||||
table.table(title -> {
|
|
||||||
title.addImage(mech.icon(Cicon.xlarge)).size(8 * 6);
|
|
||||||
title.add("[accent]" + mech.localizedName).padLeft(5);
|
|
||||||
});
|
|
||||||
table.left().defaults().left();
|
|
||||||
|
|
||||||
table.row();
|
|
||||||
|
|
||||||
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
|
|
||||||
|
|
||||||
table.row();
|
|
||||||
|
|
||||||
if(mech.description != null){
|
|
||||||
table.add(mech.displayDescription()).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
|
||||||
table.row();
|
|
||||||
|
|
||||||
table.addImage().height(3).color(Color.lightGray).pad(15).padLeft(0).padRight(0).fillX();
|
|
||||||
table.row();
|
|
||||||
}
|
|
||||||
|
|
||||||
table.left().defaults().fillX();
|
|
||||||
|
|
||||||
if(Core.bundle.has("mech." + mech.name + ".weapon")){
|
|
||||||
table.add(Core.bundle.format("mech.weapon", Core.bundle.get("mech." + mech.name + ".weapon")));
|
|
||||||
table.row();
|
|
||||||
}
|
|
||||||
if(Core.bundle.has("mech." + mech.name + ".ability")){
|
|
||||||
table.add(Core.bundle.format("mech.ability", Core.bundle.get("mech." + mech.name + ".ability")));
|
|
||||||
table.row();
|
|
||||||
}
|
|
||||||
|
|
||||||
table.add(Core.bundle.format("mech.buildspeed", (int)(mech.buildPower * 100f)));
|
|
||||||
table.row();
|
|
||||||
|
|
||||||
table.add(Core.bundle.format("mech.health", (int)mech.health));
|
|
||||||
table.row();
|
|
||||||
table.add(Core.bundle.format("mech.itemcapacity", mech.itemCapacity));
|
|
||||||
table.row();
|
|
||||||
|
|
||||||
if(mech.drillPower > 0){
|
|
||||||
table.add(Core.bundle.format("mech.minespeed", (int)(mech.mineSpeed * 100f)));
|
|
||||||
table.row();
|
|
||||||
table.add(Core.bundle.format("mech.minepower", mech.drillPower));
|
|
||||||
table.row();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static void displayUnit(Table table, UnitDef unit){
|
public static void displayUnit(Table table, UnitDef unit){
|
||||||
table.table(title -> {
|
table.table(title -> {
|
||||||
title.addImage(unit.icon(Cicon.xlarge)).size(8 * 6);
|
title.addImage(unit.icon(Cicon.xlarge)).size(8 * 6);
|
||||||
|
|||||||
Reference in New Issue
Block a user