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
This interface uses dot-notation paths to navigate nested JSON structures.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getArenaData(String path, Class<T> type)
    Gets typed data from the arena configuration JSON file.
    Gets a location from arena configuration data.
    <T> T
    getGameData(String path, Class<T> type)
    Gets typed data from the game's configuration JSON file.
    Gets a location from game configuration data.
    boolean
    Checks if a path exists in the arena configuration.
    boolean
    Checks if a path exists in the game configuration.
  • Method Details

    • getGameData

      <T> T getGameData(String path, Class<T> type)
      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 value
      type - the class of the expected type
      Returns:
      the value at the specified path, or null if not found
    • getArenaData

      <T> T getArenaData(String path, Class<T> type)
      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 value
      type - the class of the expected type
      Returns:
      the value at the specified path, or null if not found
    • getGameLocation

      L getGameLocation(String path)
      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

      L getArenaLocation(String path)
      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

      boolean hasGameData(String path)
      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

      boolean hasArenaData(String path)
      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