Effect Serializer
Serialize Alchemist effect groups from/to file in human readable format (JSON).
This class can be considered a clean boundary between Google Gson library and the needs of this project, providing methods to serialize and deserialize from JSON files instances of EffectGroup.
The GSON object used for serialization is statically updated at runtime with all available TypeAdapters
and RuntimeTypeAdapter
.
See also
com. google. gson. Gson
Functions
Link copied to clipboard
open fun <P : Position2D<out P>?> effectFromFile(effectFile: File): EffectFX<P>
Content copied to clipboard
Get an Effect from the specified file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectFromResources(resource: String): EffectFX<P>
Content copied to clipboard
Get an Effect from the specified resource file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectGroupsFromFile(effectFile: File): List<EffectGroup<P>>
Content copied to clipboard
Get a list of EffectGroup from the specified file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectGroupsFromResources(resource: String): List<EffectGroup<P>>
Content copied to clipboard
Get a list of EffectGroup from the specified resource file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectGroupsToFile(effectFile: File, effects: List<EffectGroup<P>>)
Content copied to clipboard
Write the given list of EffectGroups to the destination file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectsFromFile(effectFile: File): EffectGroup<P>
Content copied to clipboard
Get an EffectGroup from the specified file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectsFromResources(resource: String): EffectGroup<P>
Content copied to clipboard
Get an EffectGroup from the specified resource file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectsToFile(effectFile: File, effects: EffectGroup<P>)
Content copied to clipboard
Write the given EffectGroup to the destination file.
Link copied to clipboard
open fun <P : Position2D<out P>?> effectToFile(effectFile: File, effect: EffectFX<P>)
Content copied to clipboard
Write the given EffectFX to the destination file.