mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-02 05:54:26 +02:00
refactor: move OptionsContainer
to own class file
BREAKING-CHANGE: this changes the package
This commit is contained in:
parent
db21d5e953
commit
d37452997b
@ -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
|
||||||
|
}
|
||||||
|
}
|
@ -20,20 +20,6 @@ sealed interface Patch<out T : Data> {
|
|||||||
fun execute(data: @UnsafeVariance T): PatchResult
|
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.
|
* Resource patch for the Patcher.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user