Merge pull request #35 from BeefEX/feature_fluid-rework
This commit is contained in:
@@ -1,16 +1,40 @@
|
||||
package io.anuke.mindustry.resource;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public enum Item{
|
||||
stone, iron, coal, steel, titanium, dirium, uranium;
|
||||
public class Item{
|
||||
|
||||
public String localized(){
|
||||
return Bundles.get("item."+name() + ".name");
|
||||
public static final Array<Item> items = new Array<>();
|
||||
|
||||
public static final Item stone = new Item("stone");
|
||||
public static final Item iron = new Item("iron");
|
||||
public static final Item coal = new Item("coal");
|
||||
public static final Item steel = new Item("steel");
|
||||
public static final Item titanium = new Item("titanium");
|
||||
public static final Item dirium = new Item("dirium");
|
||||
public static final Item uranium = new Item("uranium");
|
||||
|
||||
public final int id;
|
||||
public final String name;
|
||||
|
||||
public Item(String name) {
|
||||
this.id = items.size;
|
||||
this.name = name;
|
||||
|
||||
Item.items.add(this);
|
||||
}
|
||||
|
||||
public String localizedName(){
|
||||
return Bundles.get("item." + this.name + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return localized();
|
||||
return localizedName();
|
||||
}
|
||||
|
||||
public static Array<Item> getAllItems() {
|
||||
return Item.items;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,41 @@
|
||||
package io.anuke.mindustry.resource;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public enum Liquid{
|
||||
water(Color.ROYAL),
|
||||
plasma(Color.CORAL),
|
||||
lava(Color.valueOf("ed5334")),
|
||||
oil(Color.valueOf("292929"));
|
||||
public class Liquid {
|
||||
|
||||
public static final Array<Liquid> liquids = new Array<>();
|
||||
|
||||
public static final Liquid water = new Liquid("water", Color.ROYAL);
|
||||
public static final Liquid plasma = new Liquid("plasma", Color.CORAL);
|
||||
public static final Liquid lava = new Liquid("lava", Color.valueOf("ed5334"));
|
||||
public static final Liquid oil = new Liquid("oil", Color.valueOf("292929"));
|
||||
|
||||
public final Color color;
|
||||
public final String name;
|
||||
public final int id;
|
||||
|
||||
private Liquid(Color color){
|
||||
public Liquid(String name, Color color) {
|
||||
this.name = name;
|
||||
this.color = new Color(color);
|
||||
|
||||
this.id = liquids.size;
|
||||
|
||||
Liquid.liquids.add(this);
|
||||
}
|
||||
|
||||
public String localized(){
|
||||
return Bundles.get("liquid."+name() + ".name");
|
||||
public String localizedName(){
|
||||
return Bundles.get("liquid."+ this.name + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return localized();
|
||||
return localizedName();
|
||||
}
|
||||
|
||||
public static Array<Liquid> getAllLiquids() {
|
||||
return Liquid.liquids;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user