Skip to content

Commit

Permalink
refactor: move OptionsContainer to own class file
Browse files Browse the repository at this point in the history
BREAKING-CHANGE: this changes the package
  • Loading branch information
oSumAtrIX committed Oct 4, 2022
1 parent db21d5e commit d374529
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
18 changes: 18 additions & 0 deletions src/main/kotlin/app/revanced/patcher/patch/OptionsContainer.kt
Original file line number Diff line number Diff line change
@@ -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
}
}
14 changes: 0 additions & 14 deletions src/main/kotlin/app/revanced/patcher/patch/Patch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit d374529

Please sign in to comment.