From: fred-boy Date: Wed, 25 Apr 2018 07:02:20 +0000 (+0700) Subject: Move misc classes X-Git-Tag: alpha0.4~108 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=e7be8067d83f2a39c237ec7afbe115a846a74f3d;p=cavedroid.git Move misc classes --- diff --git a/core/src/ru/deadsoftware/cavecraft/CaveGame.java b/core/src/ru/deadsoftware/cavecraft/CaveGame.java index c03d568..edf3206 100644 --- a/core/src/ru/deadsoftware/cavecraft/CaveGame.java +++ b/core/src/ru/deadsoftware/cavecraft/CaveGame.java @@ -2,6 +2,7 @@ package ru.deadsoftware.cavecraft; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; +import ru.deadsoftware.cavecraft.misc.AppState; public class CaveGame extends Game { diff --git a/core/src/ru/deadsoftware/cavecraft/GameScreen.java b/core/src/ru/deadsoftware/cavecraft/GameScreen.java index 37dc45e..d359fe9 100644 --- a/core/src/ru/deadsoftware/cavecraft/GameScreen.java +++ b/core/src/ru/deadsoftware/cavecraft/GameScreen.java @@ -4,7 +4,9 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import ru.deadsoftware.cavecraft.game.GameProc; import ru.deadsoftware.cavecraft.game.GameSaver; +import ru.deadsoftware.cavecraft.game.Items; import ru.deadsoftware.cavecraft.menu.MenuRenderer; +import ru.deadsoftware.cavecraft.misc.*; public class GameScreen implements Screen { diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInput.java b/core/src/ru/deadsoftware/cavecraft/game/GameInput.java index 2ff2fa3..bded581 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameInput.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameInput.java @@ -2,10 +2,9 @@ package ru.deadsoftware.cavecraft.game; import com.badlogic.gdx.Input; import com.badlogic.gdx.utils.TimeUtils; -import ru.deadsoftware.cavecraft.AppState; -import ru.deadsoftware.cavecraft.Assets; +import ru.deadsoftware.cavecraft.misc.AppState; +import ru.deadsoftware.cavecraft.misc.Assets; import ru.deadsoftware.cavecraft.CaveGame; -import ru.deadsoftware.cavecraft.Items; public class GameInput { diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java index 07587e6..5677c24 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java @@ -5,7 +5,6 @@ import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; import ru.deadsoftware.cavecraft.CaveGame; -import ru.deadsoftware.cavecraft.Items; import ru.deadsoftware.cavecraft.game.mobs.Mob; import ru.deadsoftware.cavecraft.game.objects.Player; diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java index 29b3d3b..ccf5e2b 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java @@ -2,12 +2,13 @@ package ru.deadsoftware.cavecraft.game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; -import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.TimeUtils; import ru.deadsoftware.cavecraft.*; import ru.deadsoftware.cavecraft.game.mobs.Mob; import ru.deadsoftware.cavecraft.game.mobs.Pig; import ru.deadsoftware.cavecraft.game.objects.Player; +import ru.deadsoftware.cavecraft.misc.AppState; +import ru.deadsoftware.cavecraft.misc.Assets; import java.io.Serializable; import java.util.ArrayList; diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java index 2db89c3..7f693c4 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java @@ -3,10 +3,9 @@ package ru.deadsoftware.cavecraft.game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.math.Vector2; -import ru.deadsoftware.cavecraft.Assets; +import ru.deadsoftware.cavecraft.misc.Assets; import ru.deadsoftware.cavecraft.CaveGame; -import ru.deadsoftware.cavecraft.Items; -import ru.deadsoftware.cavecraft.Renderer; +import ru.deadsoftware.cavecraft.misc.Renderer; import ru.deadsoftware.cavecraft.game.mobs.Mob; import ru.deadsoftware.cavecraft.game.objects.Player; diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java b/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java index e86fb3a..7885d2e 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java @@ -2,7 +2,6 @@ package ru.deadsoftware.cavecraft.game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.math.Vector2; -import ru.deadsoftware.cavecraft.Items; public class GameWorld { diff --git a/core/src/ru/deadsoftware/cavecraft/Items.java b/core/src/ru/deadsoftware/cavecraft/game/Items.java similarity index 91% rename from core/src/ru/deadsoftware/cavecraft/Items.java rename to core/src/ru/deadsoftware/cavecraft/game/Items.java index 001ac29..e28062f 100644 --- a/core/src/ru/deadsoftware/cavecraft/Items.java +++ b/core/src/ru/deadsoftware/cavecraft/game/Items.java @@ -1,7 +1,8 @@ -package ru.deadsoftware.cavecraft; +package ru.deadsoftware.cavecraft.game; import com.badlogic.gdx.utils.ArrayMap; import ru.deadsoftware.cavecraft.game.objects.Block; +import ru.deadsoftware.cavecraft.misc.Assets; public class Items { @@ -9,7 +10,7 @@ public class Items { public static void loadBlocks() { BLOCKS.put("none", null); - BLOCKS.put("stone", new Block(0,0,16,16,Assets.blockTextures[0])); + BLOCKS.put("stone", new Block(0,0,16,16, Assets.blockTextures[0])); BLOCKS.put("grass", new Block(0,0,16,16,Assets.blockTextures[1])); BLOCKS.put("dirt", new Block(0,0,16,16,Assets.blockTextures[2])); BLOCKS.put("cobblestone", new Block(0,0,16,16,Assets.blockTextures[3])); diff --git a/core/src/ru/deadsoftware/cavecraft/game/mobs/Mob.java b/core/src/ru/deadsoftware/cavecraft/game/mobs/Mob.java index 61ab375..cfa932a 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/mobs/Mob.java +++ b/core/src/ru/deadsoftware/cavecraft/game/mobs/Mob.java @@ -3,8 +3,7 @@ package ru.deadsoftware.cavecraft.game.mobs; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; -import ru.deadsoftware.cavecraft.Assets; +import ru.deadsoftware.cavecraft.misc.Assets; import java.io.Serializable; diff --git a/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java b/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java index 7b92238..879b667 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java +++ b/core/src/ru/deadsoftware/cavecraft/game/mobs/Pig.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; -import ru.deadsoftware.cavecraft.Assets; +import ru.deadsoftware.cavecraft.misc.Assets; import ru.deadsoftware.cavecraft.game.GameProc; public class Pig extends Mob{ diff --git a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java index faf1eb3..acfad3d 100644 --- a/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/menu/MenuRenderer.java @@ -4,7 +4,11 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.utils.Array; import ru.deadsoftware.cavecraft.*; import ru.deadsoftware.cavecraft.game.GameSaver; +import ru.deadsoftware.cavecraft.game.Items; import ru.deadsoftware.cavecraft.menu.objects.Button; +import ru.deadsoftware.cavecraft.misc.AppState; +import ru.deadsoftware.cavecraft.misc.Assets; +import ru.deadsoftware.cavecraft.misc.Renderer; public class MenuRenderer extends Renderer { diff --git a/core/src/ru/deadsoftware/cavecraft/AppState.java b/core/src/ru/deadsoftware/cavecraft/misc/AppState.java similarity index 81% rename from core/src/ru/deadsoftware/cavecraft/AppState.java rename to core/src/ru/deadsoftware/cavecraft/misc/AppState.java index be65138..7a86332 100644 --- a/core/src/ru/deadsoftware/cavecraft/AppState.java +++ b/core/src/ru/deadsoftware/cavecraft/misc/AppState.java @@ -1,4 +1,4 @@ -package ru.deadsoftware.cavecraft; +package ru.deadsoftware.cavecraft.misc; public enum AppState { GOTO_NEW_GAME, diff --git a/core/src/ru/deadsoftware/cavecraft/Assets.java b/core/src/ru/deadsoftware/cavecraft/misc/Assets.java similarity index 98% rename from core/src/ru/deadsoftware/cavecraft/Assets.java rename to core/src/ru/deadsoftware/cavecraft/misc/Assets.java index 6a992ef..f3d1226 100644 --- a/core/src/ru/deadsoftware/cavecraft/Assets.java +++ b/core/src/ru/deadsoftware/cavecraft/misc/Assets.java @@ -1,4 +1,4 @@ -package ru.deadsoftware.cavecraft; +package ru.deadsoftware.cavecraft.misc; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; @@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.GlyphLayout; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.TextureRegion; +import ru.deadsoftware.cavecraft.CaveGame; public class Assets { diff --git a/core/src/ru/deadsoftware/cavecraft/InputHandlerGame.java b/core/src/ru/deadsoftware/cavecraft/misc/InputHandlerGame.java similarity index 98% rename from core/src/ru/deadsoftware/cavecraft/InputHandlerGame.java rename to core/src/ru/deadsoftware/cavecraft/misc/InputHandlerGame.java index e22caec..ffc38cc 100644 --- a/core/src/ru/deadsoftware/cavecraft/InputHandlerGame.java +++ b/core/src/ru/deadsoftware/cavecraft/misc/InputHandlerGame.java @@ -1,7 +1,8 @@ -package ru.deadsoftware.cavecraft; +package ru.deadsoftware.cavecraft.misc; import com.badlogic.gdx.Input; import com.badlogic.gdx.InputProcessor; +import ru.deadsoftware.cavecraft.CaveGame; import ru.deadsoftware.cavecraft.game.GameInput; import ru.deadsoftware.cavecraft.game.GameProc; diff --git a/core/src/ru/deadsoftware/cavecraft/InputHandlerMenu.java b/core/src/ru/deadsoftware/cavecraft/misc/InputHandlerMenu.java similarity index 90% rename from core/src/ru/deadsoftware/cavecraft/InputHandlerMenu.java rename to core/src/ru/deadsoftware/cavecraft/misc/InputHandlerMenu.java index 232e217..74110ea 100644 --- a/core/src/ru/deadsoftware/cavecraft/InputHandlerMenu.java +++ b/core/src/ru/deadsoftware/cavecraft/misc/InputHandlerMenu.java @@ -1,6 +1,7 @@ -package ru.deadsoftware.cavecraft; +package ru.deadsoftware.cavecraft.misc; import com.badlogic.gdx.InputProcessor; +import ru.deadsoftware.cavecraft.GameScreen; import ru.deadsoftware.cavecraft.menu.MenuRenderer; import ru.deadsoftware.cavecraft.menu.objects.Button; @@ -34,7 +35,7 @@ public class InputHandlerMenu implements InputProcessor{ @Override public boolean touchUp(int screenX, int screenY, int pointer, int mb) { - screenX *= renderer.getWidth()/GameScreen.getWidth(); + screenX *= renderer.getWidth()/ GameScreen.getWidth(); screenY *= renderer.getHeight()/GameScreen.getHeight(); for (Button button : renderer.menuMainButtons) { if (button.getRect().contains(screenX, screenY) && button.getType()>0) renderer.buttonClicked(button); diff --git a/core/src/ru/deadsoftware/cavecraft/Renderer.java b/core/src/ru/deadsoftware/cavecraft/misc/Renderer.java similarity index 92% rename from core/src/ru/deadsoftware/cavecraft/Renderer.java rename to core/src/ru/deadsoftware/cavecraft/misc/Renderer.java index 43ea03e..f083a32 100644 --- a/core/src/ru/deadsoftware/cavecraft/Renderer.java +++ b/core/src/ru/deadsoftware/cavecraft/misc/Renderer.java @@ -1,8 +1,10 @@ -package ru.deadsoftware.cavecraft; +package ru.deadsoftware.cavecraft.misc; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import ru.deadsoftware.cavecraft.GameScreen; +import ru.deadsoftware.cavecraft.misc.Assets; public abstract class Renderer {