DEADSOFTWARE

Rename BlocksLoader to Items
authorfred-boy <fred-boy@protonmail.com>
Fri, 6 Apr 2018 15:42:59 +0000 (22:42 +0700)
committerfred-boy <fred-boy@protonmail.com>
Fri, 6 Apr 2018 15:42:59 +0000 (22:42 +0700)
core/src/ru/deadsoftware/cavecraft/GameScreen.java
core/src/ru/deadsoftware/cavecraft/Items.java [moved from core/src/ru/deadsoftware/cavecraft/BlocksLoader.java with 94% similarity]
core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java

index efdce0440b8bb2a74d179fdd6188ee211ff59671..30382a83cf63183f947658bd251f5fce656fc9a0 100644 (file)
@@ -5,7 +5,6 @@ import com.badlogic.gdx.InputProcessor;
 import com.badlogic.gdx.Screen;
 import ru.deadsoftware.cavecraft.game.GameInputHandler;
 import ru.deadsoftware.cavecraft.game.GameProc;
-import ru.deadsoftware.cavecraft.game.GameRenderer;
 
 public class GameScreen implements Screen {
 
@@ -14,7 +13,7 @@ public class GameScreen implements Screen {
 
     public GameScreen() {
         Assets.load();
-        BlocksLoader.load();
+        Items.load();
         gameProc = new GameProc();
         gameInput = new GameInputHandler(gameProc);
         Gdx.input.setInputProcessor(new InputHandler());
similarity index 94%
rename from core/src/ru/deadsoftware/cavecraft/BlocksLoader.java
rename to core/src/ru/deadsoftware/cavecraft/Items.java
index 0d453c9883609312becd34256f44785987680e33..2a4071fd8aa29d6681c02f41cfbaaeead1e081d8 100644 (file)
@@ -3,7 +3,7 @@ package ru.deadsoftware.cavecraft;
 import com.badlogic.gdx.utils.ArrayMap;
 import ru.deadsoftware.cavecraft.game.objects.Block;
 
-public class BlocksLoader {
+public class Items {
 
     public static ArrayMap<String, Block> BLOCKS = new ArrayMap<String, Block>();
 
index 54ec384e040cf91cf688cce9b31ba7bcd9ad357f..42bd07e21c7b20004514d3613709134272c6c8a4 100644 (file)
@@ -6,10 +6,9 @@ import com.badlogic.gdx.graphics.OrthographicCamera;
 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
 import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
 import com.badlogic.gdx.graphics.Color;
-import com.badlogic.gdx.math.Rectangle;
 import com.badlogic.gdx.math.Vector3;
 import ru.deadsoftware.cavecraft.Assets;
-import ru.deadsoftware.cavecraft.BlocksLoader;
+import ru.deadsoftware.cavecraft.Items;
 import ru.deadsoftware.cavecraft.GameScreen;
 import ru.deadsoftware.cavecraft.game.objects.Player;
 
@@ -65,11 +64,11 @@ public class GameRenderer {
             for (int x=minX; x<maxX; x++) {
                 if (gameProc.world.getForeMap(x,y)>0) {
                     spriteBatch.draw(
-                            BlocksLoader.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).getTexture(),
+                            Items.BLOCKS.getValueAt(gameProc.world.getForeMap(x,y)).getTexture(),
                             x * 16 - camera.position.x,y * 16 - camera.position.y);
                 } else if (gameProc.world.getBackMap(x,y)>0) {
                     spriteBatch.draw(
-                            BlocksLoader.BLOCKS.getValueAt(gameProc.world.getBackMap(x,y)).getTexture(),
+                            Items.BLOCKS.getValueAt(gameProc.world.getBackMap(x,y)).getTexture(),
                             x * 16 - camera.position.x,y * 16 - camera.position.y);
                     Assets.shade.setPosition(x * 16 - camera.position.x,y * 16 - camera.position.y);
                     Assets.shade.draw(spriteBatch);
@@ -89,7 +88,7 @@ public class GameRenderer {
                 camera.viewportHeight - Assets.invBar.getRegionHeight());
         for (int i=0; i<8; i++) {
             if (gameProc.player.inventory[i]>0) {
-                spriteBatch.draw(BlocksLoader.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(),
+                spriteBatch.draw(Items.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(),
                         camera.viewportWidth/2 - Assets.invBar.getRegionWidth()/2+3+i*20,
                         camera.viewportHeight-19);
             }