Changes
This commit is contained in:
parent
882d5466f8
commit
3d390ddf43
@ -23,13 +23,13 @@ package com.pixelgamelibrary.api;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface GameI extends ApplicationListener {
|
||||
public interface Game extends ApplicationListener {
|
||||
|
||||
void create();
|
||||
|
||||
void setScreen(ScreenI screen);
|
||||
void setScreen(Screen screen);
|
||||
|
||||
ScreenI getScreen();
|
||||
Screen getScreen();
|
||||
|
||||
void render();
|
||||
|
@ -24,9 +24,9 @@ package com.pixelgamelibrary.api;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class GameAdapter implements GameI {
|
||||
public class GameAdapter implements Game {
|
||||
|
||||
private ScreenI screen;
|
||||
private Screen screen;
|
||||
private OnSetScreenListener setOnSetScreenListener;
|
||||
@Override
|
||||
public void create() {
|
||||
@ -34,7 +34,7 @@ public class GameAdapter implements GameI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScreen(ScreenI screen) {
|
||||
public void setScreen(Screen screen) {
|
||||
this.screen = screen;
|
||||
System.out.println("setOnSetScreenListener=" + setOnSetScreenListener);
|
||||
if(setOnSetScreenListener != null) {
|
||||
@ -44,7 +44,7 @@ public class GameAdapter implements GameI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScreenI getScreen() {
|
||||
public Screen getScreen() {
|
||||
return screen;
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,11 @@ package com.pixelgamelibrary.api;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class GameWrapper implements GameI {
|
||||
public class GameWrapper implements Game {
|
||||
|
||||
private final GameI game;
|
||||
private final Game game;
|
||||
|
||||
public GameWrapper(GameI gameI) {
|
||||
public GameWrapper(Game gameI) {
|
||||
this.game = gameI;
|
||||
}
|
||||
|
||||
@ -39,12 +39,12 @@ public class GameWrapper implements GameI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScreen(ScreenI screen) {
|
||||
public void setScreen(Screen screen) {
|
||||
game.setScreen(screen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScreenI getScreen() {
|
||||
public Screen getScreen() {
|
||||
return game.getScreen();
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,6 @@ package com.pixelgamelibrary.api;
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface OnSetScreenListener {
|
||||
void onSetScreen(ScreenI screen);
|
||||
void onSetScreen(Screen screen);
|
||||
|
||||
}
|
||||
|
@ -19,16 +19,15 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.pixelgamelibrary.api;
|
||||
|
||||
import com.pixelgamelibrary.api.interfaces.AppI;
|
||||
import com.pixelgamelibrary.api.interfaces.AssetI;
|
||||
import com.pixelgamelibrary.api.interfaces.AudioI;
|
||||
import com.pixelgamelibrary.api.interfaces.GraphicsI;
|
||||
import com.pixelgamelibrary.api.interfaces.InputI;
|
||||
import com.pixelgamelibrary.api.interfaces.InternalI;
|
||||
import com.pixelgamelibrary.api.interfaces.NetI;
|
||||
import com.pixelgamelibrary.api.interfaces.PixelBackend;
|
||||
import com.pixelgamelibrary.api.interfaces.StorageI;
|
||||
import com.pixelgamelibrary.api.interfaces.UtilsI;
|
||||
import com.pixelgamelibrary.api.interfaces.Files;
|
||||
import com.pixelgamelibrary.api.interfaces.Audio;
|
||||
import com.pixelgamelibrary.api.interfaces.Graphics;
|
||||
import com.pixelgamelibrary.api.interfaces.Input;
|
||||
import com.pixelgamelibrary.api.interfaces.Internal;
|
||||
import com.pixelgamelibrary.api.interfaces.Net;
|
||||
import com.pixelgamelibrary.api.interfaces.Utils;
|
||||
import com.pixelgamelibrary.api.interfaces.App;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -47,39 +46,35 @@ public class Pixel {
|
||||
}
|
||||
|
||||
////
|
||||
public static AppI app() {
|
||||
public static App app() {
|
||||
return get().app();
|
||||
}
|
||||
|
||||
public static GraphicsI graphics() {
|
||||
public static Graphics graphics() {
|
||||
return get().graphics();
|
||||
}
|
||||
|
||||
public static AudioI audio() {
|
||||
public static Audio audio() {
|
||||
return get().audio();
|
||||
}
|
||||
|
||||
public static InputI input() {
|
||||
public static Input input() {
|
||||
return get().input();
|
||||
}
|
||||
|
||||
public static NetI net() {
|
||||
public static Net net() {
|
||||
return get().net();
|
||||
}
|
||||
|
||||
public static AssetI asset() {
|
||||
return get().asset();
|
||||
public static Files files() {
|
||||
return get().files();
|
||||
}
|
||||
|
||||
public static StorageI storage() {
|
||||
return get().storage();
|
||||
}
|
||||
|
||||
public static UtilsI utils() {
|
||||
public static Utils utils() {
|
||||
return get().utils();
|
||||
}
|
||||
|
||||
public static InternalI internal() {
|
||||
public static Internal internal() {
|
||||
return get().internal();
|
||||
}
|
||||
////
|
||||
|
@ -27,12 +27,12 @@ import java.util.Map;
|
||||
* @author robertvokac
|
||||
*/
|
||||
public abstract class PixelApplication {
|
||||
abstract public GameI createGameViaMap(Map<String, Object> objects);
|
||||
abstract public Game createGameViaMap(Map<String, Object> objects);
|
||||
|
||||
public GameI createGame() {
|
||||
public Game createGame() {
|
||||
return createGame(new HashMap<>());
|
||||
}
|
||||
public GameI createGame(Object... objects) {
|
||||
public Game createGame(Object... objects) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
int i = 0;
|
||||
int maxI = objects.length - 1;
|
||||
|
@ -17,14 +17,20 @@
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.pixelgamelibrary.api.interfaces;
|
||||
|
||||
import com.pixelgamelibrary.api.storage.Storage;
|
||||
package com.pixelgamelibrary.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface AssetI {
|
||||
Storage getAssets();
|
||||
public enum PixelFeature {
|
||||
SOCKETS,
|
||||
WEBSOCKETS,
|
||||
AUDIO,
|
||||
TOUCHSCREEN,
|
||||
ACCELERATOR,
|
||||
GYROSCOP,
|
||||
VIBRATION,
|
||||
MOUSE,
|
||||
KEYBOARD;
|
||||
}
|
@ -23,7 +23,7 @@ package com.pixelgamelibrary.api;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface ScreenI extends ApplicationListener {
|
||||
public interface Screen extends ApplicationListener {
|
||||
|
||||
void render(float delta);
|
||||
}
|
@ -23,8 +23,8 @@ package com.pixelgamelibrary.api;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class ScreenAdapter implements ScreenI{
|
||||
private GameI game = null;
|
||||
public class ScreenAdapter implements Screen{
|
||||
private Game game = null;
|
||||
|
||||
@Override
|
||||
public void resize(int width, int height) {
|
||||
|
@ -25,11 +25,11 @@ package com.pixelgamelibrary.api;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class ScreenWrapper implements ScreenI {
|
||||
public class ScreenWrapper implements Screen {
|
||||
|
||||
private final ScreenI screen;
|
||||
private final Screen screen;
|
||||
|
||||
public ScreenWrapper(ScreenI screenIn) {
|
||||
public ScreenWrapper(Screen screenIn) {
|
||||
this.screen = screenIn;
|
||||
}
|
||||
@Override
|
||||
|
29
src/main/java/com/pixelgamelibrary/api/View.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/View.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public enum View {
|
||||
STRETCH, FIT, SCREEN, EXTEND;
|
||||
}
|
@ -19,14 +19,18 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.pixelgamelibrary.api.interfaces;
|
||||
|
||||
import com.pixelgamelibrary.api.GameI;
|
||||
import com.pixelgamelibrary.api.PixelFeature;
|
||||
import com.pixelgamelibrary.api.Platform;
|
||||
import com.pixelgamelibrary.api.Game;
|
||||
import com.pixelgamelibrary.api.utils.ClipBoard;
|
||||
import com.pixelgamelibrary.api.utils.LogLevel;
|
||||
import com.pixelgamelibrary.api.utils.Preferences;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface AppI {
|
||||
public interface App {
|
||||
Platform getPlatform();
|
||||
|
||||
default boolean isOneOfPlatforms(Platform ... platforms) {
|
||||
@ -42,12 +46,17 @@ public interface AppI {
|
||||
void warn(String msg);
|
||||
void error(String msg);
|
||||
void debug(String msg);
|
||||
void setLogLevel(LogLevel logLevel);
|
||||
Preferences getPreferences(String preferencesName);
|
||||
void setAppName(String appName);
|
||||
String getAppName();
|
||||
boolean isAppNameSet();
|
||||
|
||||
void setGame(GameI game);
|
||||
void setGame(Game game);
|
||||
|
||||
GameI getGame();
|
||||
|
||||
Game getGame();
|
||||
boolean isFeatureEnabled(PixelFeature feature);
|
||||
boolean isMobileDevice();
|
||||
void postRunnable(Runnable runnable);
|
||||
ClipBoard getClipBoard();
|
||||
}
|
@ -23,6 +23,7 @@ package com.pixelgamelibrary.api.interfaces;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface AudioI {
|
||||
public interface Audio {
|
||||
//Add MIDI support - todo
|
||||
|
||||
}
|
@ -19,12 +19,50 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.pixelgamelibrary.api.interfaces;
|
||||
|
||||
import com.pixelgamelibrary.api.storage.FileHandle;
|
||||
import com.pixelgamelibrary.api.storage.Storage;
|
||||
import com.pixelgamelibrary.api.storage.StorageException;
|
||||
import com.pixelgamelibrary.api.storage.StorageType;
|
||||
import static com.pixelgamelibrary.api.storage.StorageType.ASSETS;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface StorageI {
|
||||
Storage getStorage();
|
||||
public interface Files {
|
||||
|
||||
Storage local();
|
||||
|
||||
Storage assets();
|
||||
|
||||
Storage external();
|
||||
|
||||
Storage relative(String absolutePath);
|
||||
|
||||
Storage absolute();
|
||||
|
||||
Storage tmp();
|
||||
|
||||
default FileHandle file(java.lang.String path, StorageType type) {
|
||||
switch (type) {
|
||||
case ASSETS:
|
||||
return assets().file(path);
|
||||
case LOCAL:
|
||||
return local().file(path);
|
||||
case EXTERNAL:
|
||||
return external().file(path);
|
||||
case ABSOLUTE:
|
||||
return absolute().file(path);
|
||||
case TMP:
|
||||
return tmp().file(path);
|
||||
default:
|
||||
throw new StorageException("Unsupported StorageType: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
boolean isExternalStorageAvailable();
|
||||
|
||||
String getLocalStoragePath();
|
||||
|
||||
String getExternalStoragePath();
|
||||
}
|
@ -20,13 +20,16 @@
|
||||
package com.pixelgamelibrary.api.interfaces;
|
||||
|
||||
import com.pixelgamelibrary.api.WindowMode;
|
||||
import com.pixelgamelibrary.api.utils.Monitor;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface GraphicsI {
|
||||
public interface Graphics {
|
||||
boolean setToOriginalDisplayMode();
|
||||
WindowMode setDisplayMode(boolean fullscreen, boolean window);
|
||||
List<Monitor> getMonitors();
|
||||
|
||||
}
|
@ -23,6 +23,6 @@ package com.pixelgamelibrary.api.interfaces;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface InputI {
|
||||
public interface Input {
|
||||
|
||||
}
|
@ -24,5 +24,5 @@ package com.pixelgamelibrary.api.interfaces;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface InternalI {
|
||||
public interface Internal {
|
||||
}
|
@ -23,6 +23,6 @@ package com.pixelgamelibrary.api.interfaces;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface NetI {
|
||||
public interface Net {
|
||||
|
||||
}
|
@ -25,14 +25,13 @@ package com.pixelgamelibrary.api.interfaces;
|
||||
*/
|
||||
public interface PixelBackend {
|
||||
|
||||
AppI app();
|
||||
GraphicsI graphics();
|
||||
AudioI audio();
|
||||
InputI input();
|
||||
NetI net();
|
||||
AssetI asset();
|
||||
StorageI storage();
|
||||
UtilsI utils();
|
||||
InternalI internal();
|
||||
App app();
|
||||
Graphics graphics();
|
||||
Audio audio();
|
||||
Input input();
|
||||
Net net();
|
||||
Files files();
|
||||
Utils utils();
|
||||
Internal internal();
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.pixelgamelibrary.api.interfaces;
|
||||
|
||||
import com.pixelgamelibrary.api.utils.CollectionUtils;
|
||||
import com.pixelgamelibrary.api.utils.ReflectionUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -29,11 +31,13 @@ import java.util.stream.Stream;
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface UtilsI {
|
||||
public interface Utils {
|
||||
XmlElement parseXml(String xmlString);
|
||||
default String decodeBase64AsString(String string) {
|
||||
return new String(decodeBase64AsByteArray(string));
|
||||
}
|
||||
|
||||
//json support - todo
|
||||
|
||||
byte[] decodeBase64AsByteArray(String string);
|
||||
|
||||
@ -51,5 +55,7 @@ public interface UtilsI {
|
||||
default Stream<String> splitStringToLinesAsStream(String string) {
|
||||
return Arrays.asList(string.split("\\r?\\n")).stream();
|
||||
}
|
||||
ReflectionUtils reflection();
|
||||
CollectionUtils collections();
|
||||
|
||||
}
|
@ -17,7 +17,6 @@
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.storage;
|
||||
|
||||
import java.util.List;
|
||||
@ -27,39 +26,68 @@ import java.util.List;
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface FileHandle {
|
||||
|
||||
FileType type();
|
||||
String path ();
|
||||
String name ();
|
||||
String extension ();
|
||||
String nameWithoutExtension ();
|
||||
List<FileHandle> list();
|
||||
default boolean isDirectory() {
|
||||
return type() == FileType.DIRECTORY;
|
||||
}
|
||||
|
||||
default boolean isRegularFile() {
|
||||
return type() == FileType.FILE;
|
||||
}
|
||||
FileHandle child(String name);
|
||||
FileHandle sibling(String name);
|
||||
FileHandle parent();
|
||||
boolean mkdir();
|
||||
boolean mkdirs();
|
||||
boolean exists();
|
||||
boolean delete();
|
||||
boolean deleteDirectory();
|
||||
boolean emptyDirectory();
|
||||
boolean copyTo(FileHandle destination);
|
||||
boolean moveTo(FileHandle destination);
|
||||
|
||||
long length();
|
||||
FileHandle tempFile (String prefix);
|
||||
FileHandle tempDirectory (String prefix);
|
||||
int depth();
|
||||
boolean writeString(String text);
|
||||
boolean appendString(String text);
|
||||
String readString();
|
||||
|
||||
boolean writeBytes(byte[] data);
|
||||
byte[] readBytes();
|
||||
|
||||
String path();
|
||||
|
||||
String name();
|
||||
|
||||
String extension();
|
||||
|
||||
String nameWithoutExtension();
|
||||
|
||||
List<FileHandle> list();
|
||||
|
||||
default boolean isDirectory() {
|
||||
return type() == FileType.DIRECTORY;
|
||||
}
|
||||
|
||||
default boolean isRegularFile() {
|
||||
return type() == FileType.FILE;
|
||||
}
|
||||
|
||||
FileHandle child(String name);
|
||||
|
||||
FileHandle sibling(String name);
|
||||
|
||||
FileHandle parent();
|
||||
|
||||
boolean mkdir();
|
||||
|
||||
boolean mkdirs();
|
||||
|
||||
boolean exists();
|
||||
|
||||
boolean delete();
|
||||
|
||||
boolean deleteDirectory();
|
||||
|
||||
boolean emptyDirectory();
|
||||
|
||||
boolean copyTo(FileHandle destination);
|
||||
|
||||
boolean moveTo(FileHandle destination);
|
||||
|
||||
long length();
|
||||
|
||||
FileHandle tempFile(String prefix);
|
||||
|
||||
FileHandle tempDirectory(String prefix);
|
||||
|
||||
int depth();
|
||||
|
||||
boolean writeString(String text);
|
||||
|
||||
boolean appendString(String text);
|
||||
|
||||
String readString();
|
||||
|
||||
boolean writeBytes(byte[] data);
|
||||
|
||||
byte[] readBytes();
|
||||
|
||||
void flush();
|
||||
|
||||
Storage getStorage();
|
||||
}
|
||||
|
@ -221,4 +221,14 @@ public class FileHandleImpl implements FileHandle {
|
||||
return storage.readBytes(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public Storage getStorage() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ import com.pixelgamelibrary.api.Platform;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This interface provides the methods to interact with the underlying storage system.
|
||||
* It supports basic file system operations such as navigating directories, creating files
|
||||
* and directories, and reading/writing data.
|
||||
*
|
||||
* This interface provides the methods to interact with the underlying storage
|
||||
* system. It supports basic file system operations such as navigating
|
||||
* directories, creating files and directories, and reading/writing data.
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Storage {
|
||||
@ -35,23 +35,23 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Returns the platform associated with this storage.
|
||||
*
|
||||
*
|
||||
* @return the platform object.
|
||||
*/
|
||||
Platform getPlatform();
|
||||
|
||||
/**
|
||||
* Changes the current working directory to the specified path.
|
||||
*
|
||||
*
|
||||
* @param path the path to change to.
|
||||
* @return a result message or an empty string if successful.
|
||||
*/
|
||||
public String changeDirectory(String path);
|
||||
|
||||
/**
|
||||
* Changes the directory to the default "home/user" directory, creating the necessary
|
||||
* directories if they do not exist.
|
||||
*
|
||||
* Changes the directory to the default "home/user" directory, creating the
|
||||
* necessary directories if they do not exist.
|
||||
*
|
||||
* @return a result message or an empty string if successful.
|
||||
*/
|
||||
default String changeDirectory() {
|
||||
@ -65,7 +65,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Creates a directory with the specified name.
|
||||
*
|
||||
*
|
||||
* @param argument the name of the directory to create.
|
||||
* @return a result message or an empty string if successful.
|
||||
*/
|
||||
@ -73,7 +73,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Creates multiple directories specified by the arguments.
|
||||
*
|
||||
*
|
||||
* @param argument the names of the directories to create.
|
||||
* @return a result message or an empty string if successful.
|
||||
*/
|
||||
@ -92,14 +92,14 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Returns the current working directory.
|
||||
*
|
||||
*
|
||||
* @return the path of the current working directory.
|
||||
*/
|
||||
public String printWorkingDirectory();
|
||||
|
||||
/**
|
||||
* Lists the contents of the specified directory.
|
||||
*
|
||||
*
|
||||
* @param workingDirectory the directory to list.
|
||||
* @return a list of file and directory names in the specified directory.
|
||||
*/
|
||||
@ -107,8 +107,9 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Lists the contents of the current working directory.
|
||||
*
|
||||
* @return a list of file and directory names in the current working directory.
|
||||
*
|
||||
* @return a list of file and directory names in the current working
|
||||
* directory.
|
||||
*/
|
||||
default List<String> list() {
|
||||
return list(printWorkingDirectory());
|
||||
@ -116,7 +117,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Returns the depth of the specified directory path in the directory tree.
|
||||
*
|
||||
*
|
||||
* @param path the path to calculate depth for.
|
||||
* @return the depth of the path.
|
||||
*/
|
||||
@ -132,7 +133,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Returns the depth of the current working directory in the directory tree.
|
||||
*
|
||||
*
|
||||
* @return the depth of the current working directory.
|
||||
*/
|
||||
default int depth() {
|
||||
@ -141,7 +142,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Creates an empty file with the specified name.
|
||||
*
|
||||
*
|
||||
* @param name the name of the file to create.
|
||||
* @return a result message or an empty string if successful.
|
||||
*/
|
||||
@ -149,7 +150,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Removes the file with the specified name.
|
||||
*
|
||||
*
|
||||
* @param name the name of the file to remove.
|
||||
* @return true if the file was successfully removed, false otherwise.
|
||||
*/
|
||||
@ -157,7 +158,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Removes the directory with the specified name.
|
||||
*
|
||||
*
|
||||
* @param dirname the name of the directory to remove.
|
||||
* @return true if the directory was successfully removed, false otherwise.
|
||||
*/
|
||||
@ -165,7 +166,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Copies a file from the source path to the target path.
|
||||
*
|
||||
*
|
||||
* @param source the source file path.
|
||||
* @param target the target file path.
|
||||
* @return a result message or an empty string if successful.
|
||||
@ -174,7 +175,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Moves a file from the source path to the target path.
|
||||
*
|
||||
*
|
||||
* @param source the source file path.
|
||||
* @param target the target file path.
|
||||
* @return a result message or an empty string if successful.
|
||||
@ -183,7 +184,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Reads the contents of a text file with the specified name.
|
||||
*
|
||||
*
|
||||
* @param name the name of the file to read.
|
||||
* @return the text content of the file.
|
||||
*/
|
||||
@ -191,7 +192,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Reads the contents of a binary file with the specified name.
|
||||
*
|
||||
*
|
||||
* @param name the name of the file to read.
|
||||
* @return the binary content of the file.
|
||||
*/
|
||||
@ -199,7 +200,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Saves the specified text content to a file with the given name.
|
||||
*
|
||||
*
|
||||
* @param name the name of the file to save.
|
||||
* @param text the text content to save.
|
||||
* @return a result message or an empty string if successful.
|
||||
@ -208,7 +209,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Saves the specified binary data to a file with the given name.
|
||||
*
|
||||
*
|
||||
* @param name the name of the file to save.
|
||||
* @param data the binary data to save.
|
||||
* @return a result message or an empty string if successful.
|
||||
@ -217,7 +218,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Checks whether a file or directory with the specified name exists.
|
||||
*
|
||||
*
|
||||
* @param name the name to check for existence.
|
||||
* @return true if the file or directory exists, false otherwise.
|
||||
*/
|
||||
@ -225,7 +226,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Checks whether the specified name refers to a file.
|
||||
*
|
||||
*
|
||||
* @param name the name to check.
|
||||
* @return true if the name refers to a file, false otherwise.
|
||||
*/
|
||||
@ -233,15 +234,16 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Checks whether the specified name refers to a directory.
|
||||
*
|
||||
*
|
||||
* @param name the name to check.
|
||||
* @return true if the name refers to a directory, false otherwise.
|
||||
*/
|
||||
public boolean isDirectory(String name);
|
||||
|
||||
/**
|
||||
* Returns a debug string with information about the current state of the storage.
|
||||
*
|
||||
* Returns a debug string with information about the current state of the
|
||||
* storage.
|
||||
*
|
||||
* @return a debug string.
|
||||
*/
|
||||
public String debug();
|
||||
@ -253,7 +255,7 @@ public interface Storage {
|
||||
|
||||
/**
|
||||
* Returns the username associated with this storage.
|
||||
*
|
||||
*
|
||||
* @return the username.
|
||||
*/
|
||||
default String getUserName() {
|
||||
@ -261,9 +263,9 @@ public interface Storage {
|
||||
}
|
||||
|
||||
/**
|
||||
* If the size of this storage is limited, returns the number of bytes it is limited to.
|
||||
* Otherwise, returns 0.
|
||||
*
|
||||
* If the size of this storage is limited, returns the number of bytes it is
|
||||
* limited to. Otherwise, returns 0.
|
||||
*
|
||||
* @return the size limit in bytes, or 0 if there is no limit.
|
||||
*/
|
||||
default long getSizeLimit() {
|
||||
@ -274,20 +276,20 @@ public interface Storage {
|
||||
* The default username for the storage.
|
||||
*/
|
||||
static final String USER = "user";
|
||||
|
||||
|
||||
default FileHandle file(String path) {
|
||||
path = convertToAbsolutePathIfNeeded(path);
|
||||
return new FileHandleImpl(this, path);
|
||||
}
|
||||
|
||||
default FileHandle file() {
|
||||
return file(printWorkingDirectory());
|
||||
}
|
||||
|
||||
|
||||
FileType type(String path);
|
||||
|
||||
|
||||
RegularFileType getRegularFileType(String path);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Converts a path to an absolute path if it is not already absolute.
|
||||
*
|
||||
@ -300,9 +302,10 @@ public interface Storage {
|
||||
}
|
||||
return printWorkingDirectory() + (printWorkingDirectory().equals("/") ? "" : SLASH) + path;
|
||||
}
|
||||
|
||||
default boolean isTextFile(String content) {
|
||||
try {
|
||||
|
||||
|
||||
// Check if the content contains any non-printable characters
|
||||
for (int i = 0; i < content.length(); i++) {
|
||||
char c = content.charAt(i);
|
||||
@ -317,4 +320,37 @@ public interface Storage {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves and returns the current state of the storage.
|
||||
*
|
||||
* @param methodName
|
||||
* @return
|
||||
*/
|
||||
byte[] backup(String methodName);
|
||||
|
||||
/**
|
||||
* Replaces the current content of the storage.
|
||||
* @param methodName
|
||||
* @param data
|
||||
*/
|
||||
void restore(String methodName, byte[] data);
|
||||
|
||||
boolean isReadonly();
|
||||
|
||||
/**
|
||||
* Returns the maximum size in count of bytes of the storage. If the maximum
|
||||
* size is not defined for this storage, then 0 is returned. default long
|
||||
* getMaxSize() { return 0; }
|
||||
*
|
||||
* /**
|
||||
* Deletes all the content in the storage.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
long size();
|
||||
|
||||
StorageType getStorageType();
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
package com.pixelgamelibrary.api.storage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public enum StorageType {
|
||||
ASSETS,
|
||||
LOCAL,
|
||||
EXTERNAL,
|
||||
ABSOLUTE,
|
||||
TMP,
|
||||
UNDEFINED;
|
||||
}
|
@ -25,6 +25,7 @@ import com.pixelgamelibrary.api.storage.FileType;
|
||||
import com.pixelgamelibrary.api.storage.RegularFileType;
|
||||
import com.pixelgamelibrary.api.storage.StorageException;
|
||||
import com.pixelgamelibrary.api.storage.Storage;
|
||||
import com.pixelgamelibrary.api.storage.StorageType;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -407,4 +408,39 @@ public class MapStorage implements Storage {
|
||||
|
||||
return text.startsWith(BINARYFILE) ? RegularFileType.BINARY : RegularFileType.TEXT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] backup(String methodName) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restore(String methodName, byte[] data) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadonly() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public long size() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageType getStorageType() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
}
|
||||
|
29
src/main/java/com/pixelgamelibrary/api/utils/Animation.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/Animation.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Animation {
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface AudioDevice {
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface AudioRecorder {
|
||||
|
||||
}
|
29
src/main/java/com/pixelgamelibrary/api/utils/Camera.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/Camera.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Camera {
|
||||
|
||||
}
|
32
src/main/java/com/pixelgamelibrary/api/utils/ClipBoard.java
Normal file
32
src/main/java/com/pixelgamelibrary/api/utils/ClipBoard.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class ClipBoard {
|
||||
public ClipBoard() {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface CollectionUtils {
|
||||
|
||||
}
|
29
src/main/java/com/pixelgamelibrary/api/utils/Color.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/Color.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Color {
|
||||
|
||||
}
|
32
src/main/java/com/pixelgamelibrary/api/utils/Cursor.java
Normal file
32
src/main/java/com/pixelgamelibrary/api/utils/Cursor.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class Cursor {
|
||||
public Cursor() {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public enum CursorViewWithoutMouse {
|
||||
NONE, NORMAL, MOVE;
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class DisplayMode {
|
||||
private int width, height, refreshRate, bitsPerPixel;
|
||||
|
||||
public DisplayMode() {
|
||||
|
||||
}
|
||||
|
||||
}
|
29
src/main/java/com/pixelgamelibrary/api/utils/Disposable.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/Disposable.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Disposable {
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface LifecycleListener {
|
||||
|
||||
}
|
29
src/main/java/com/pixelgamelibrary/api/utils/LogLevel.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/LogLevel.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public enum LogLevel {
|
||||
NONE, ERROR, INFO, WARN, DEBUG;
|
||||
}
|
32
src/main/java/com/pixelgamelibrary/api/utils/Monitor.java
Normal file
32
src/main/java/com/pixelgamelibrary/api/utils/Monitor.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class Monitor {
|
||||
public Monitor() {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
29
src/main/java/com/pixelgamelibrary/api/utils/PixMap.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/PixMap.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface PixMap {
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Preferences {
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface ReflectionUtils {
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface ShapeRenderer {
|
||||
|
||||
}
|
29
src/main/java/com/pixelgamelibrary/api/utils/Sprite.java
Normal file
29
src/main/java/com/pixelgamelibrary/api/utils/Sprite.java
Normal file
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Sprite {
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface SpriteBatch {
|
||||
|
||||
//https://libgdx.com/wiki/graphics/2d/spritebatch-textureregions-and-sprites
|
||||
//draw (Texture texture, float x, float y) Draws the texture using the texture's width and height.
|
||||
//draw (Texture texture, float x, float y, int srcX, int srcY, int srcWidth, int srcHeight) Draws a portion of the texture.
|
||||
//draw (Texture texture, float x, float y, float width, float height, int srcX, int srcY, int srcWidth, int srcHeight, boolean flipX, boolean flipY) Draws a portion of a texture, stretched to the width and height, and optionally flipped.
|
||||
//draw (Texture texture, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation, int srcX, int srcY, int srcWidth, int srcHeight, boolean flipX, boolean flipY) This monster method draws a portion of a texture, stretched to the width and height, scaled and rotated around an origin, and optionally flipped.
|
||||
//draw (Texture texture, float x, float y, float width, float height, float u, float v, float u2, float v2) This draws a portion of a texture, stretched to the width and height. This is a somewhat advanced method as it uses texture coordinates from 0-1 rather than pixel coordinates.
|
||||
//draw (Texture texture, float[] spriteVertices, int offset, int length) This is an advanced method for passing in the raw geometry, texture coordinates, and color information. This can be used to draw any quadrilateral, not just rectangles.
|
||||
|
||||
}
|
30
src/main/java/com/pixelgamelibrary/api/utils/Texture.java
Normal file
30
src/main/java/com/pixelgamelibrary/api/utils/Texture.java
Normal file
@ -0,0 +1,30 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public interface Texture {
|
||||
void makeColorTransparent(int r, int g, int b);
|
||||
void scale(double d);
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class TextureAtlas {
|
||||
public TextureAtlas() {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class TextureRegion {
|
||||
public TextureRegion() {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public class TmpDirectoryRegistry {
|
||||
public TmpDirectoryRegistry() {
|
||||
//todo
|
||||
}
|
||||
|
||||
}
|
@ -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
|
||||
// <https://www.gnu.org/licenses/> or write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.pixelgamelibrary.api.utils;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author robertvokac
|
||||
*/
|
||||
public enum VibrationType {
|
||||
NONE, ERROR, INFO, WARN, DEBUG;
|
||||
}
|
@ -1,18 +1,8 @@
|
||||
package com.pixelgamelibrary.api.storage.map;
|
||||
|
||||
import com.pixelgamelibrary.api.GameI;
|
||||
import com.pixelgamelibrary.api.Pixel;
|
||||
import com.pixelgamelibrary.api.Platform;
|
||||
import com.pixelgamelibrary.api.interfaces.AppI;
|
||||
import com.pixelgamelibrary.api.interfaces.AssetI;
|
||||
import com.pixelgamelibrary.api.interfaces.AudioI;
|
||||
import com.pixelgamelibrary.api.interfaces.GraphicsI;
|
||||
import com.pixelgamelibrary.api.interfaces.InputI;
|
||||
import com.pixelgamelibrary.api.interfaces.InternalI;
|
||||
import com.pixelgamelibrary.api.interfaces.NetI;
|
||||
import com.pixelgamelibrary.api.interfaces.PixelBackend;
|
||||
import com.pixelgamelibrary.api.interfaces.StorageI;
|
||||
import com.pixelgamelibrary.api.interfaces.UtilsI;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
@ -21,6 +11,19 @@ import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
import com.pixelgamelibrary.api.interfaces.Files;
|
||||
import com.pixelgamelibrary.api.interfaces.Audio;
|
||||
import com.pixelgamelibrary.api.interfaces.Graphics;
|
||||
import com.pixelgamelibrary.api.interfaces.Input;
|
||||
import com.pixelgamelibrary.api.interfaces.Internal;
|
||||
import com.pixelgamelibrary.api.interfaces.Net;
|
||||
import com.pixelgamelibrary.api.interfaces.Utils;
|
||||
import com.pixelgamelibrary.api.interfaces.App;
|
||||
import com.pixelgamelibrary.api.Game;
|
||||
import com.pixelgamelibrary.api.PixelFeature;
|
||||
import com.pixelgamelibrary.api.utils.ClipBoard;
|
||||
import com.pixelgamelibrary.api.utils.LogLevel;
|
||||
import com.pixelgamelibrary.api.utils.Preferences;
|
||||
|
||||
// Tests for MapStorage class
|
||||
public class MapStorageTest {
|
||||
@ -32,8 +35,8 @@ public class MapStorageTest {
|
||||
|
||||
PixelBackend dummyPixelBackend = new PixelBackend() {
|
||||
@Override
|
||||
public AppI app() {
|
||||
return new AppI() {
|
||||
public App app() {
|
||||
return new App() {
|
||||
@Override
|
||||
public Platform getPlatform() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
@ -79,12 +82,42 @@ public class MapStorageTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGame(GameI game) {
|
||||
public void setGame(Game game) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameI getGame() {
|
||||
public Game getGame() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogLevel(LogLevel logLevel) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public Preferences getPreferences(String preferencesName) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFeatureEnabled(PixelFeature feature) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMobileDevice() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postRunnable(Runnable runnable) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClipBoard getClipBoard() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@ -92,42 +125,37 @@ public class MapStorageTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GraphicsI graphics() {
|
||||
public Graphics graphics() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public AudioI audio() {
|
||||
public Audio audio() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputI input() {
|
||||
public Input input() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public NetI net() {
|
||||
public Net net() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public AssetI asset() {
|
||||
public Files files() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageI storage() {
|
||||
public Utils utils() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public UtilsI utils() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
@Override
|
||||
public InternalI internal() {
|
||||
public Internal internal() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user