DEADSOFTWARE

Nonnull by default
authorfred-boy <fredboy@protonmail.com>
Mon, 23 Dec 2019 08:28:31 +0000 (15:28 +0700)
committerfred-boy <fredboy@protonmail.com>
Mon, 23 Dec 2019 08:28:31 +0000 (15:28 +0700)
14 files changed:
core/src/ru/deadsoftware/cavedroid/game/GamePhysics.java
core/src/ru/deadsoftware/cavedroid/game/GameSaver.java
core/src/ru/deadsoftware/cavedroid/game/GameWorld.java
core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java
core/src/ru/deadsoftware/cavedroid/game/mobs/FallingSand.java
core/src/ru/deadsoftware/cavedroid/game/mobs/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/game/objects/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/game/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/menu/objects/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/menu/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/menu/submenus/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/misc/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/misc/states/package-info.java [new file with mode: 0644]
core/src/ru/deadsoftware/cavedroid/package-info.java [new file with mode: 0644]

index ed31da7433799f44ed0544f8f8f5d5aedd9aea2d..8ebb260cb8c3d39c227de71339babd835e7f910b 100644 (file)
@@ -4,7 +4,6 @@ import com.badlogic.gdx.math.Intersector;
 import com.badlogic.gdx.math.MathUtils;
 import com.badlogic.gdx.math.Rectangle;
 import com.badlogic.gdx.math.Vector2;
-import org.jetbrains.annotations.NotNull;
 import ru.deadsoftware.cavedroid.CaveGame;
 import ru.deadsoftware.cavedroid.game.mobs.Mob;
 import ru.deadsoftware.cavedroid.game.mobs.Player;
@@ -25,7 +24,7 @@ class GamePhysics {
      *
      * @return true if mob should jump
      */
-    private boolean checkJump(@NotNull Mob mob) {
+    private boolean checkJump(Mob mob) {
         int dir = mob.looksLeft() ? 0 : 1;
         int blX = (int) (mob.getX() + mob.getWidth() * dir - 8 + 16 * dir);
         int blY = (int) (mob.getY() + mob.getHeight() - 8);
@@ -39,7 +38,7 @@ class GamePhysics {
                 (mob.getY() + mob.getHeight()) - GameItems.getBlock(block).getRect(blX / 16, blY / 16).y > 8);
     }
 
-    private boolean checkColl(@NotNull Rectangle rect) {
+    private boolean checkColl(Rectangle rect) {
         int minX = (int) ((rect.x + rect.width / 2) / 16) - 4;
         int minY = (int) ((rect.y + rect.height / 2) / 16) - 4;
         int maxX = (int) ((rect.x + rect.width / 2) / 16) + 4;
@@ -68,7 +67,7 @@ class GamePhysics {
         return false;
     }
 
-    private int getBlock(@NotNull Rectangle rect) {
+    private int getBlock(Rectangle rect) {
         return GP.world.getForeMap((int) (rect.x + rect.width / 2) / 16,
                 (int) (rect.y + rect.height / 8 * 7) / 16);
     }
index 49822863f876b074fe28f25e10aab9a376951aab..38e295931f27b864ed98fa94ecad05698e323e94 100644 (file)
@@ -2,7 +2,6 @@ package ru.deadsoftware.cavedroid.game;
 
 import com.badlogic.gdx.Gdx;
 import com.badlogic.gdx.files.FileHandle;
-import org.jetbrains.annotations.NotNull;
 import ru.deadsoftware.cavedroid.CaveGame;
 
 import java.io.*;
@@ -12,12 +11,12 @@ public class GameSaver {
 
     private static final int VERSION = 0;
 
-    @NotNull
+
     private static byte[] intToBytes(int i) {
         return ByteBuffer.allocate(4).putInt(i).array();
     }
 
-    private static void saveMap(@NotNull FileHandle file, @NotNull int[][] map) throws IOException {
+    private static void saveMap(FileHandle file, int[][] map) throws IOException {
         int rl, bl;
         int width = map.length;
         int height = map[0].length;
@@ -44,8 +43,8 @@ public class GameSaver {
         out.close();
     }
 
-    @NotNull
-    private static int[][] loadMap(@NotNull FileHandle file) throws Exception {
+
+    private static int[][] loadMap(FileHandle file) throws Exception {
         int[][] map;
         int ver, width, height;
         int rl, bl;
index 0c4435045898d292016c756237a3adb758471ecd..01ddee9c111de4c81be866d4293cb7497d77b503 100644 (file)
@@ -1,6 +1,5 @@
 package ru.deadsoftware.cavedroid.game;
 
-import org.jetbrains.annotations.NotNull;
 import ru.deadsoftware.cavedroid.game.objects.Block;
 import ru.deadsoftware.cavedroid.game.objects.Drop;
 
@@ -23,7 +22,7 @@ public class GameWorld {
         WorldGen.clear();
     }
 
-    GameWorld(@NotNull int[][] foreMap, @NotNull int[][] backMap) {
+    GameWorld(int[][] foreMap, int[][] backMap) {
         this.foreMap = foreMap.clone();
         this.backMap = backMap.clone();
         WIDTH = foreMap.length;
index fb567049394d79329a7ced59fb7a770c1224f2e3..c46def34abd58598d3655979ed25fbd6e2c6c32f 100644 (file)
@@ -2,7 +2,6 @@ package ru.deadsoftware.cavedroid.game.mobs;
 
 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
 import com.badlogic.gdx.math.Vector2;
-import org.jetbrains.annotations.NotNull;
 import ru.deadsoftware.cavedroid.misc.Assets;
 
 import static ru.deadsoftware.cavedroid.GameScreen.GP;
@@ -36,7 +35,7 @@ public class FallingGravel extends Mob {
     }
 
     @Override
-    public void draw(@NotNull SpriteBatch spriteBatch, float x, float y) {
+    public void draw(SpriteBatch spriteBatch, float x, float y) {
         spriteBatch.draw(Assets.gravelSprite, x, y);
     }
 
index 0f44f051e6645df7d785f6ae40180be01a9ba308..ee310e44179f1c557c512a0cd720a8dc4d41f384 100644 (file)
@@ -2,7 +2,6 @@ package ru.deadsoftware.cavedroid.game.mobs;
 
 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
 import com.badlogic.gdx.math.Vector2;
-import org.jetbrains.annotations.NotNull;
 import ru.deadsoftware.cavedroid.misc.Assets;
 
 import static ru.deadsoftware.cavedroid.GameScreen.GP;
@@ -36,7 +35,7 @@ public class FallingSand extends Mob {
     }
 
     @Override
-    public void draw(@NotNull SpriteBatch spriteBatch, float x, float y) {
+    public void draw(SpriteBatch spriteBatch, float x, float y) {
         spriteBatch.draw(Assets.sandSprite, x, y);
     }
 
diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/package-info.java b/core/src/ru/deadsoftware/cavedroid/game/mobs/package-info.java
new file mode 100644 (file)
index 0000000..ed9b92d
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.game.mobs;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/game/objects/package-info.java b/core/src/ru/deadsoftware/cavedroid/game/objects/package-info.java
new file mode 100644 (file)
index 0000000..a12210b
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.game.objects;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/game/package-info.java b/core/src/ru/deadsoftware/cavedroid/game/package-info.java
new file mode 100644 (file)
index 0000000..d73a0b6
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.game;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/menu/objects/package-info.java b/core/src/ru/deadsoftware/cavedroid/menu/objects/package-info.java
new file mode 100644 (file)
index 0000000..f511278
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.menu.objects;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/menu/package-info.java b/core/src/ru/deadsoftware/cavedroid/menu/package-info.java
new file mode 100644 (file)
index 0000000..92cd147
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.menu;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/menu/submenus/package-info.java b/core/src/ru/deadsoftware/cavedroid/menu/submenus/package-info.java
new file mode 100644 (file)
index 0000000..6a5aa76
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.menu.submenus;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/package-info.java b/core/src/ru/deadsoftware/cavedroid/misc/package-info.java
new file mode 100644 (file)
index 0000000..f2c7913
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.misc;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/misc/states/package-info.java b/core/src/ru/deadsoftware/cavedroid/misc/states/package-info.java
new file mode 100644 (file)
index 0000000..bc647bf
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid.misc.states;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file
diff --git a/core/src/ru/deadsoftware/cavedroid/package-info.java b/core/src/ru/deadsoftware/cavedroid/package-info.java
new file mode 100644 (file)
index 0000000..9bfa3e8
--- /dev/null
@@ -0,0 +1,4 @@
+@ParametersAreNonnullByDefault
+package ru.deadsoftware.cavedroid;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file