DEADSOFTWARE

Implement dependency injection for game classes #13
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / objects / Block.java
index b6628cb20a1f283ab17f63a61e833a79461e9032..0800b5b5cb8d8f713aef6e017a4c7af355675c79 100644 (file)
@@ -14,6 +14,7 @@ public class Block {
     private final int hp;
     private final String drop;
     private final String meta;
+    @CheckForNull
     private final Sprite tex;
 
     private final boolean coll;
@@ -85,11 +86,12 @@ public class Block {
         return !drop.equals("none");
     }
 
-    public Sprite getTex() {
+    public Sprite getTexture() {
+        assert tex != null;
         return tex;
     }
 
-    public Rectangle getRect(int x, int y) {
+    public Rectangle getRectangle(int x, int y) {
         x *= 16;
         y *= 16;
         return new Rectangle(x + this.x, y + this.y, w, h);