Class TextAssetPool<T extends Asset>

java.lang.Object
dev.prozilla.pine.common.asset.pool.AssetPool<T>
dev.prozilla.pine.common.asset.pool.TextAssetPool<T>
All Implemented Interfaces:
Destructible
Direct Known Subclasses:
ShaderPool, StyleSheetPool

public abstract class TextAssetPool<T extends Asset> extends AssetPool<T>
Abstract class for pools of assets that are created from text files.
  • Constructor Details

    • TextAssetPool

      public TextAssetPool()
  • Method Details

    • createAsset

      protected T createAsset(String path)
      Creates a new asset by reading and parsing a text file.
      Specified by:
      createAsset in class AssetPool<T extends Asset>
      Parameters:
      path - The path of the text file
      Returns:
      The new asset
    • parse

      protected abstract T parse(String path, String content)
      Parses the text file as an asset.
      Parameters:
      path - The path of the text file. Mostly used for debugging purposes.
      content - The content of the text file
      Returns:
      The new asset
    • normalize

      protected String normalize(String path)
      Description copied from class: AssetPool
      Normalizes a path.
      Overrides:
      normalize in class AssetPool<T extends Asset>
      Parameters:
      path - The path
      Returns:
      The normalized path.