diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java b/core/src/ru/deadsoftware/cavedroid/game/objects/Item.java
index a619a1babfdcfd94e3c76a2fb86261d88f00055d..8e664ace9bf0a134783d92e7bca5781eb91ba41d 100644 (file)
import com.badlogic.gdx.graphics.g2d.Sprite;
+import javax.annotation.CheckForNull;
+
public class Item {
- private String name, type;
- private Sprite tex;
+ private final String name;
+ private final String type;
+ @CheckForNull
+ private final Sprite tex;
- public Item(String name, String type, Sprite tex) {
+ public Item(String name, String type, @CheckForNull Sprite tex) {
this.name = name;
this.type = type;
this.tex = tex;
- if (this.tex != null) this.tex.flip(false, true);
+ if (this.tex != null) {
+ this.tex.flip(false, true);
+ }
}
- public Sprite getTex() {
+ public Sprite getTexture() {
+ assert tex != null;
return tex;
}