30 Zeilen
1.1 KiB
Java
30 Zeilen
1.1 KiB
Java
package de.steamwar.bausystem.configplayer;
|
|
|
|
import yapion.hierarchy.types.YAPIONObject;
|
|
|
|
public interface ConfigConverter {
|
|
|
|
/**
|
|
* This describes the version this Converter can convert from. The version
|
|
* it should convert to is the version 1 above this number. But this is not
|
|
* a necessity. In the config Object as parameter given in {@link #update(YAPIONObject)}
|
|
* you should update the <b>@version</b> variable in the root object to the
|
|
* new version this converter produced.
|
|
*
|
|
* @return the version number
|
|
*/
|
|
int version();
|
|
|
|
/**
|
|
* This method should update everything needed to go from a lower config
|
|
* version to a higher. It should update the <b>@version</b> variable
|
|
* accordingly. Anything else is up the implementation. If anything goes wrong
|
|
* do not silently exit this method, throw an Exception. The updater Code will
|
|
* deal with it. Never leave the inputted object in a corrupted state.
|
|
*
|
|
* @param config the config object to update
|
|
*/
|
|
void update(YAPIONObject config);
|
|
|
|
}
|