X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fgame%2Fobjects%2FItem.java;h=9868a96b18d0d0dfe4a2c502cf29c50f7193f96a;hb=59d48c1b28c570755327a8fb0827fa57e7fd3914;hp=3d082bf4d8ef46b3232d1ec61eb68633113e6a3f;hpb=0a855ca3c1d0c84de41a928cc99fd8544a933015;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java b/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java index 3d082bf..9868a96 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java +++ b/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java @@ -1,37 +1,38 @@ package ru.deadsoftware.cavedroid.game.objects; -public class Item { +import com.badlogic.gdx.graphics.g2d.Sprite; - private int tex; - private int type; // 0 - block, 1 - tool, 2 - other - private int block; - private String name; +import javax.annotation.CheckForNull; - public Item(String name, int tex, int type) { - this(name, tex, type, -1); - } +public class Item { - public Item(String name, int tex, int type, int block) { + private final String name; + private final String type; + private final Sprite tex; + + public Item(String name, String type, @CheckForNull Sprite tex) { this.name = name; - this.tex = tex; this.type = type; - this.block = block; + this.tex = tex; + if (this.tex != null) { + this.tex.flip(false, true); + } } - public int getTex() { + public Sprite getTex() { return tex; } - public int getType() { + public String getType() { return type; } - public int getBlock() { - return block; + public boolean isBlock() { + return type.equals("block"); } public String getName() { return name; } -} +} \ No newline at end of file