manueldidonna / pokemon-save-editor-android

A work-in-progress pokémon save editor for Android
GNU General Public License v3.0
0 stars 0 forks source link

Load Pokemon from files #10

Open manueldidonna opened 4 years ago

manueldidonna commented 4 years ago

Create an immutable Pokemon instance from a file which has been converted to a UByteArray. The machism is the same used by SaveData.Factory

interface Pokemon {
    interface Factory {
        /**
         * Create a [Pokemon] instance from an array of bytes 
         * or null it it doesn't rapresent a valid pokemon.

         */
        fun create(data: UByteArray, position: Position): Pokemon?
    }
}

Related to #1