Add ConfigConverter
Dieser Commit ist enthalten in:
Ursprung
9ba6dade14
Commit
c9af5326d1
@ -0,0 +1,29 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren