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
Abstract class for pools of assets that are created from text files.
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.asset.pool.AssetPool
eventDispatcher, NOT_FOUND_ERROR, UNKNOWN_ERROR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TcreateAsset(String path) Creates a new asset by reading and parsing a text file.protected StringNormalizes a path.protected abstract TParses the text file as an asset.protected Stringpreprocess(StringBuilder stringBuilder) Preprocesses the content of the text file.Methods inherited from class dev.prozilla.pine.common.asset.pool.AssetPool
addListener, count, createKey, destroy, fail, fail, getAssets, load, prepareNext, printInfo, printInfo, remove, remove, removeListener
-
Constructor Details
-
TextAssetPool
public TextAssetPool()
-
-
Method Details
-
createAsset
Creates a new asset by reading and parsing a text file.- Specified by:
createAssetin classAssetPool<T extends Asset>- Parameters:
path- The path of the text file- Returns:
- The new asset
-
preprocess
Preprocesses the content of the text file.- Parameters:
stringBuilder- The string builder containing the content of the text file.- Returns:
- The preprocessed content of the text file.
-
parse
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
Description copied from class:AssetPoolNormalizes a path.
-