Package net.blueva.arcade.api.config
Interface DataAccess<L>
- Type Parameters:
L- the location type (platform-specific)
public interface DataAccess<L>
Provides read-only access to arena and game configuration data from JSON files.
DataAccess reads from the arena's JSON configuration files stored at:
- Arena data:
/data/arenas/{arenaId}/arena.json - Game data:
/data/arenas/{arenaId}/games/{gameId}.json
-
Method Summary
Modifier and TypeMethodDescription<T> TgetArenaData(String path, Class<T> type) Gets typed data from the arena configuration JSON file.getArenaLocation(String path) Gets a location from arena configuration data.<T> TgetGameData(String path, Class<T> type) Gets typed data from the game's configuration JSON file.getGameLocation(String path) Gets a location from game configuration data.booleanhasArenaData(String path) Checks if a path exists in the arena configuration.booleanhasGameData(String path) Checks if a path exists in the game configuration.
-
Method Details
-
getGameData
Gets typed data from the game's configuration JSON file.Example path:
"basic.initial_music_time"to access nested values.- Type Parameters:
T- the expected return type- Parameters:
path- the dot-notation path to the valuetype- the class of the expected type- Returns:
- the value at the specified path, or null if not found
-
getArenaData
Gets typed data from the arena configuration JSON file.Example path:
"bounds.min"to access nested values.- Type Parameters:
T- the expected return type- Parameters:
path- the dot-notation path to the valuetype- the class of the expected type- Returns:
- the value at the specified path, or null if not found
-
getGameLocation
Gets a location from game configuration data.Automatically deserializes the JSON object at the path into a platform location.
- Parameters:
path- the dot-notation path to the location data- Returns:
- the location object, or null if not found
-
getArenaLocation
Gets a location from arena configuration data.Automatically deserializes the JSON object at the path into a platform location.
- Parameters:
path- the dot-notation path to the location data- Returns:
- the location object, or null if not found
-
hasGameData
Checks if a path exists in the game configuration.- Parameters:
path- the dot-notation path to check- Returns:
- true if the path exists, false otherwise
-
hasArenaData
Checks if a path exists in the arena configuration.- Parameters:
path- the dot-notation path to check- Returns:
- true if the path exists, false otherwise
-