X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fgame%2Fobjects%2FItem.java;h=a619a1babfdcfd94e3c76a2fb86261d88f00055d;hp=3d082bf4d8ef46b3232d1ec61eb68633113e6a3f;hb=4eb1f6f24fb76c0336394b85393e801fd0b99da4;hpb=e028a66c47ef4d99235b5337d57e14145acbeb2b diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java b/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java index 3d082bf..a619a1b 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java +++ b/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java @@ -1,37 +1,33 @@ 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; +public class Item { - public Item(String name, int tex, int type) { - this(name, tex, type, -1); - } + private String name, type; + private Sprite tex; - public Item(String name, int tex, int type, int block) { + public Item(String name, String type, 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