refactor: move OptionsContainer to own class file

BREAKING-CHANGE: this changes the package
This commit is contained in:
oSumAtrIX 2022-10-04 08:32:50 +02:00
parent db21d5e953
commit d37452997b
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 18 additions and 14 deletions

View File

@ -0,0 +1,18 @@
package app.revanced.patcher.patch
/**
* A container for patch options.
*/
abstract class OptionsContainer {
/**
* A list of [PatchOption]s.
* @see PatchOptions
*/
@Suppress("MemberVisibilityCanBePrivate")
val options = PatchOptions()
protected fun <T> option(opt: PatchOption<T>): PatchOption<T> {
options.register(opt)
return opt
}
}

View File

@ -20,20 +20,6 @@ sealed interface Patch<out T : Data> {
fun execute(data: @UnsafeVariance T): PatchResult
}
abstract class OptionsContainer {
/**
* A list of [PatchOption]s.
* @see PatchOptions
*/
@Suppress("MemberVisibilityCanBePrivate")
val options = PatchOptions()
protected fun <T> option(opt: PatchOption<T>): PatchOption<T> {
options.register(opt)
return opt
}
}
/**
* Resource patch for the Patcher.
*/