diff --git a/src/main/java/com/pixelgamelibrary/api/PixelException.java b/src/main/java/com/pixelgamelibrary/api/PixelException.java index cfec376..b56a282 100644 --- a/src/main/java/com/pixelgamelibrary/api/PixelException.java +++ b/src/main/java/com/pixelgamelibrary/api/PixelException.java @@ -29,5 +29,9 @@ public class PixelException extends RuntimeException{ public PixelException(String string) { super(string); } + + public PixelException(String string, Exception e) { + super(string, e); + } } diff --git a/src/main/java/com/pixelgamelibrary/api/Version.java b/src/main/java/com/pixelgamelibrary/api/Version.java new file mode 100644 index 0000000..9c3baf0 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/Version.java @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel Game Library. +// Copyright (C) 2024 Your Name or Company. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api; + +import com.pixelgamelibrary.api.PixelException; + +/** Represents the version of the game library. + * + * Author: Your Name */ +public class Version { + /** The current version of the game library in major.minor.revision format **/ + public static final String VERSION_STRING = "1.0.0"; + + /** The current major version **/ + public static final int MAJOR_VERSION; + + /** The current minor version **/ + public static final int MINOR_VERSION; + + /** The current revision version **/ + public static final int REVISION_VERSION; + + static { + try { + String[] versionParts = VERSION_STRING.split("\\."); + MAJOR_VERSION = versionParts.length < 1 ? 0 : Integer.parseInt(versionParts[0]); + MINOR_VERSION = versionParts.length < 2 ? 0 : Integer.parseInt(versionParts[1]); + REVISION_VERSION = versionParts.length < 3 ? 0 : Integer.parseInt(versionParts[2]); + } catch (Exception e) { + // This should not happen + throw new PixelException("Invalid version format: " + VERSION_STRING, e); + } + } + + public static boolean isVersionHigher(int major, int minor, int revision) { + return isVersionHigherOrEqual(major, minor, revision + 1); + } + + public static boolean isVersionHigherOrEqual(int major, int minor, int revision) { + if (MAJOR_VERSION != major) return MAJOR_VERSION > major; + if (MINOR_VERSION != minor) return MINOR_VERSION > minor; + return REVISION_VERSION >= revision; + } + + public static boolean isVersionLower(int major, int minor, int revision) { + return isVersionLowerOrEqual(major, minor, revision - 1); + } + + public static boolean isVersionLowerOrEqual(int major, int minor, int revision) { + if (MAJOR_VERSION != major) return MAJOR_VERSION < major; + if (MINOR_VERSION != minor) return MINOR_VERSION < minor; + return REVISION_VERSION <= revision; + } +} diff --git a/src/main/java/com/pixelgamelibrary/api/app/Preferences.java b/src/main/java/com/pixelgamelibrary/api/app/Preferences.java index 95be628..40fbe62 100644 --- a/src/main/java/com/pixelgamelibrary/api/app/Preferences.java +++ b/src/main/java/com/pixelgamelibrary/api/app/Preferences.java @@ -20,10 +20,12 @@ package com.pixelgamelibrary.api.app; +import com.pixelgamelibrary.api.storage.map.SimpleMap; + /** * * @author robertvokac */ -public interface Preferences { +public interface Preferences extends SimpleMap { } diff --git a/src/main/java/com/pixelgamelibrary/api/graphics/Camera.java b/src/main/java/com/pixelgamelibrary/api/graphics/Camera.java index 25ceff2..90ea62b 100644 --- a/src/main/java/com/pixelgamelibrary/api/graphics/Camera.java +++ b/src/main/java/com/pixelgamelibrary/api/graphics/Camera.java @@ -17,13 +17,21 @@ // or write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. /////////////////////////////////////////////////////////////////////////////////////////////// - package com.pixelgamelibrary.api.graphics; +import com.pixelgamelibrary.api.math.Vector2; + /** * * @author robertvokac */ public interface Camera { + + void zoom(float zoom); + void rotate(float angle); + + void translate(float x, float y); + + void translate(Vector2 vector); } diff --git a/src/main/java/com/pixelgamelibrary/api/graphics/Texture.java b/src/main/java/com/pixelgamelibrary/api/graphics/Texture.java index bd648fb..34cd08b 100644 --- a/src/main/java/com/pixelgamelibrary/api/graphics/Texture.java +++ b/src/main/java/com/pixelgamelibrary/api/graphics/Texture.java @@ -20,11 +20,19 @@ package com.pixelgamelibrary.api.graphics; +import com.pixelgamelibrary.api.Disposable; + /** * * @author robertvokac */ -public interface Texture { +public interface Texture extends Disposable { + + void draw (Pixmap pixmap, int x, int y); + int getWidth (); + int getHeight (); + int getDepth (); + // void makeColorTransparent(int r, int g, int b); void scale(double d); void setColorMode(ColorMode colorMode, int bitCount); diff --git a/src/main/java/com/pixelgamelibrary/api/graphics/TextureFactory.java b/src/main/java/com/pixelgamelibrary/api/graphics/TextureFactory.java new file mode 100644 index 0000000..0d91263 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/graphics/TextureFactory.java @@ -0,0 +1,34 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// + +package com.pixelgamelibrary.api.graphics; + +import com.pixelgamelibrary.api.storage.FileHandle; + +/** + * + * @author robertvokac + */ +public interface TextureFactory { + Texture create(String assetPath); + Texture create(FileHandle fileHandle); + Texture create(Pixmap pixmap); + Texture create(int width, int height); +} diff --git a/src/main/java/com/pixelgamelibrary/api/graphics/TextureFilter.java b/src/main/java/com/pixelgamelibrary/api/graphics/TextureFilter.java new file mode 100644 index 0000000..322afc1 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/graphics/TextureFilter.java @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// + +package com.pixelgamelibrary.api.graphics; + +/** + * + * @author robertvokac + */ +public enum TextureFilter { + NEAREST, LINEAR; + //todo + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/DeviceOrientation.java b/src/main/java/com/pixelgamelibrary/api/input/DeviceOrientation.java new file mode 100644 index 0000000..7581f83 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/DeviceOrientation.java @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// + +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public enum DeviceOrientation { + LANDSCAPE, PORTRAIT; +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/InputProcessor.java b/src/main/java/com/pixelgamelibrary/api/input/InputProcessor.java new file mode 100644 index 0000000..04d6fc8 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/InputProcessor.java @@ -0,0 +1,46 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public interface InputProcessor { + + public boolean keyDown (int keycode); + + public boolean keyUp (int keycode); + + public boolean keyTyped (char character); + + public boolean touchDown (int screenX, int screenY, int pointer, int button); + + public boolean touchUp (int screenX, int screenY, int pointer, int button); + + public boolean touchCancelled (int screenX, int screenY, int pointer, int button); + + public boolean touchDragged (int screenX, int screenY, int pointer); + + public boolean mouseMoved (int screenX, int screenY); + + public boolean scrolled (float amountX, float amountY); + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/InputProcessorAdapter.java b/src/main/java/com/pixelgamelibrary/api/input/InputProcessorAdapter.java new file mode 100644 index 0000000..31bb7c3 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/InputProcessorAdapter.java @@ -0,0 +1,73 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public class InputProcessorAdapter implements InputProcessor { + + @Override + public boolean keyDown(int keycode) { + return false; + } + + @Override + public boolean keyUp(int keycode) { + return false; + } + + @Override + public boolean keyTyped(char character) { + return false; + } + + @Override + public boolean touchDown(int screenX, int screenY, int pointer, int button) { + return false; + } + + @Override + public boolean touchUp(int screenX, int screenY, int pointer, int button) { + return false; + } + + @Override + public boolean touchCancelled(int screenX, int screenY, int pointer, int button) { + return false; + } + + @Override + public boolean touchDragged(int screenX, int screenY, int pointer) { + return false; + } + + @Override + public boolean mouseMoved(int screenX, int screenY) { + return false; + } + + @Override + public boolean scrolled(float amountX, float amountY) { + return false; + } + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/KeyboardKey.java b/src/main/java/com/pixelgamelibrary/api/input/KeyboardKey.java new file mode 100644 index 0000000..72080e9 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/KeyboardKey.java @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public enum KeyboardKey { +//todo + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/MouseButton.java b/src/main/java/com/pixelgamelibrary/api/input/MouseButton.java new file mode 100644 index 0000000..f2d4c49 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/MouseButton.java @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public enum MouseButton { + LEFT, RIGHT, MIDDLE, BACK, FORWARD; + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/OnScreenKeyboardType.java b/src/main/java/com/pixelgamelibrary/api/input/OnScreenKeyboardType.java new file mode 100644 index 0000000..6b52114 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/OnScreenKeyboardType.java @@ -0,0 +1,29 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public enum OnScreenKeyboardType { + DEFAULT, NUMBER_PAD, E_MAIL, PASSWORD, URI, GAME; + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/Peripheral.java b/src/main/java/com/pixelgamelibrary/api/input/Peripheral.java new file mode 100644 index 0000000..44a82e4 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/input/Peripheral.java @@ -0,0 +1,38 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.input; + +/** + * + * @author robertvokac + */ +public enum Peripheral { + HARDWARE_KEYBOARD, + ONSCREEN_KEYBOARD, + MULTITOUCH_SCREEN, + ACCELEROMETER, + COMPASS, + VIBRATOR, + HAPTIC_FEEDBACK, + GYROSCOPE, + ROTATION_VECTOR, + PRESSURE + +} diff --git a/src/main/java/com/pixelgamelibrary/api/input/VibrationType.java b/src/main/java/com/pixelgamelibrary/api/input/VibrationType.java index e64ef84..c5230ca 100644 --- a/src/main/java/com/pixelgamelibrary/api/input/VibrationType.java +++ b/src/main/java/com/pixelgamelibrary/api/input/VibrationType.java @@ -25,5 +25,5 @@ package com.pixelgamelibrary.api.input; * @author robertvokac */ public enum VibrationType { - + LIGHT, MEDIUM, HEAVY; } diff --git a/src/main/java/com/pixelgamelibrary/api/interfaces/App.java b/src/main/java/com/pixelgamelibrary/api/interfaces/App.java index 320e04c..dc58829 100644 --- a/src/main/java/com/pixelgamelibrary/api/interfaces/App.java +++ b/src/main/java/com/pixelgamelibrary/api/interfaces/App.java @@ -60,6 +60,6 @@ public interface App { } boolean isFeatureEnabled(String feature); boolean isMobileDevice(); - void postRunnable(Runnable runnable); + void runLater(Runnable runnable); ClipBoard getClipBoard(); } diff --git a/src/main/java/com/pixelgamelibrary/api/interfaces/Input.java b/src/main/java/com/pixelgamelibrary/api/interfaces/Input.java index 5c8a3d8..3891f69 100644 --- a/src/main/java/com/pixelgamelibrary/api/interfaces/Input.java +++ b/src/main/java/com/pixelgamelibrary/api/interfaces/Input.java @@ -19,10 +19,152 @@ /////////////////////////////////////////////////////////////////////////////////////////////// package com.pixelgamelibrary.api.interfaces; +import com.pixelgamelibrary.api.input.DeviceOrientation; +import com.pixelgamelibrary.api.input.InputProcessor; +import com.pixelgamelibrary.api.input.KeyboardKey; +import com.pixelgamelibrary.api.input.MouseButton; +import com.pixelgamelibrary.api.input.OnScreenKeyboardType; +import com.pixelgamelibrary.api.input.Peripheral; +import com.pixelgamelibrary.api.input.VibrationType; +import com.pixelgamelibrary.api.math.Vector2; +import com.pixelgamelibrary.api.math.Vector3; + /** * * @author robertvokac */ public interface Input { - + + default void unlockCursor() { + lockCursor(false); + } + + default void lockCursor() { + lockCursor(true); + } + + default void lockCursor(boolean value) { + setCursorLocked(value); + } + + void setCursorLocked(boolean value); + + boolean isCursorLocked(); + + void setCursorPosition(int x, int y); + + Vector3 getAccelerometerPosition(); + + default float getAccelerometerX() { + return getAccelerometerPosition().getX(); + } + + default float getAccelerometerY() { + return getAccelerometerPosition().getY(); + } + + default float getAccelerometerZ() { + return getAccelerometerPosition().getZ(); + } + + Vector3 getGyroscopPosition(); + + default float getGyroscopX() { + return getGyroscopPosition().getX(); + } + + default float getGyroscopY() { + return getGyroscopPosition().getY(); + } + + default float getGyroscopZ() { + return getGyroscopPosition().getZ(); + } + + int getMaxTouchPoints(); + + Vector2 getCursorPosition(); + + default float getCursorX() { + return getCursorPosition().getX(); + } + + default float getCursorY() { + return getCursorPosition().getY(); + } + + Vector2 getDeltaCursorPosition(); + + default float getDeltaCursorX() { + return getDeltaCursorPosition().getX(); + } + + default float getDeltaCursorY() { + return getDeltaCursorPosition().getY(); + } + + Vector2 getDeltaCursorPosition(int touchPointNumber); + + default float getDeltaCursorX(int touchPointNumber) { + return getDeltaCursorPosition(touchPointNumber).getX(); + } + + default float getDeltaCursorY(int touchPointNumber) { + return getDeltaCursorPosition(touchPointNumber).getY(); + } + + boolean isTouched(); + + boolean justTouched(); + + boolean isTouched(int touchPointNumber); + + float getTouchPressure(); + + float getTouchPressure(int pointer); + + boolean isMouseButtonPressed(MouseButton button); + + boolean isMouseButtonJustPressed(MouseButton button); + + boolean isKeyboardKeyPressed(KeyboardKey key); + + boolean isKeyboardKeyJustPressed(KeyboardKey key); + + void setOnscreenKeyboardVisible(boolean visible); + + void setOnscreenKeyboardVisible(boolean visible, OnScreenKeyboardType type); + + void vibrate(int milliseconds); + + void vibrate(int milliseconds, boolean fallback); + + void vibrate(int milliseconds, int amplitude, boolean fallback); + + void vibrate(VibrationType vibrationType); + + Vector3 getOrientationAngles(); + //pitch + + default float getOrientationAngleX() { + return getOrientationAngles().getX(); + } +//roll + + default float getOrientationAngleY() { + return getOrientationAngles().getY(); + } + + //azimuth + default float getOrientationAngleZ() { + return getOrientationAngles().getZ(); + } + + public void setInputProcessor(InputProcessor processor); + + public InputProcessor getInputProcessor(); + + boolean isPeripheralAvailable(Peripheral peripheral); + + DeviceOrientation getDeviceOrientation(); } diff --git a/src/main/java/com/pixelgamelibrary/api/math/Vector2.java b/src/main/java/com/pixelgamelibrary/api/math/Vector2.java new file mode 100644 index 0000000..c1f0061 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/math/Vector2.java @@ -0,0 +1,32 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.math; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@AllArgsConstructor +@Getter +@Setter +public final class Vector2 { +private int x,y; + +} diff --git a/src/main/java/com/pixelgamelibrary/api/math/Vector3.java b/src/main/java/com/pixelgamelibrary/api/math/Vector3.java new file mode 100644 index 0000000..8f025b0 --- /dev/null +++ b/src/main/java/com/pixelgamelibrary/api/math/Vector3.java @@ -0,0 +1,32 @@ +/////////////////////////////////////////////////////////////////////////////////////////////// +// Pixel: Game library. +// Copyright (C) 2024 the original author or authors. +// +// This program is free software: you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation, either version 3 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// or write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////////////////////////////////// +package com.pixelgamelibrary.api.math; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@AllArgsConstructor +@Getter +@Setter +public final class Vector3 { +private int x,y,z; + +} diff --git a/src/test/java/com/pixelgamelibrary/api/storage/map/MapStorageTest.java b/src/test/java/com/pixelgamelibrary/api/storage/map/MapStorageTest.java index 2530d7e..c0d15e9 100644 --- a/src/test/java/com/pixelgamelibrary/api/storage/map/MapStorageTest.java +++ b/src/test/java/com/pixelgamelibrary/api/storage/map/MapStorageTest.java @@ -112,7 +112,7 @@ public class MapStorageTest { } @Override - public void postRunnable(Runnable runnable) { + public void runLater(Runnable runnable) { throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody }