Skip to content

Commit

Permalink
Well... didn't actually need those
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDoot committed Feb 15, 2020
1 parent a19b6e7 commit 0cfe6e6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

allprojects {
group = "pw.dotdash"
version = "0.9.0"
version = "0.10.0"

apply(plugin = "maven")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package pw.dotdash.director.core.tree

import pw.dotdash.director.core.HList
import pw.dotdash.director.core.Parameter
import java.util.function.Consumer

interface CommandTree<in S, in V : HList<@UnsafeVariance V>, out R> : TreeExecutor<S, V, R> {

Expand All @@ -18,18 +17,12 @@ interface CommandTree<in S, in V : HList<@UnsafeVariance V>, out R> : TreeExecut

fun addChild(aliases: List<String>, init: ChildCommandTree.Builder<S, V, R>.() -> Unit): Builder<S, V, R>

fun addChild(aliases: List<String>, init: Consumer<ChildCommandTree.Builder<S, V, R>>): Builder<S, V, R>

fun addChild(vararg aliases: String, init: ChildCommandTree.Builder<S, V, R>.() -> Unit): Builder<S, V, R>

fun addChild(vararg aliases: String, init: Consumer<ChildCommandTree.Builder<S, V, R>>): Builder<S, V, R>

fun setArgument(argument: ArgumentCommandTree<S, V, *, R>): Builder<S, V, R>

fun <NV> setArgument(parameter: Parameter<S, V, NV>, init: ArgumentCommandTree.Builder<S, V, NV, R>.() -> Unit): Builder<S, V, R>

fun <NV> setArgument(parameter: Parameter<S, V, NV>, init: Consumer<ArgumentCommandTree.Builder<S, V, NV, R>>): Builder<S, V, R>

fun setExecutor(executor: (S, V) -> R): Builder<S, V, R>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,9 @@ internal sealed class SimpleCommandTree<S, V : HList<V>, R>(
override fun addChild(aliases: List<String>, init: ChildCommandTree.Builder<S, V, R>.() -> Unit): B =
this.addChild(ChildCommandTree.builder<S, V, R>().setAliases(aliases).apply(init).build())

override fun addChild(aliases: List<String>, init: Consumer<ChildCommandTree.Builder<S, V, R>>): B =
this.addChild(ChildCommandTree.builder<S, V, R>().setAliases(aliases).apply { init.accept(this) }.build())

override fun addChild(vararg aliases: String, init: ChildCommandTree.Builder<S, V, R>.() -> Unit): B =
this.addChild(ChildCommandTree.builder<S, V, R>().setAliases(*aliases).apply(init).build())

override fun addChild(vararg aliases: String, init: Consumer<ChildCommandTree.Builder<S, V, R>>): B =
this.addChild(ChildCommandTree.builder<S, V, R>().setAliases(*aliases).apply { init.accept(this) }.build())

override fun setArgument(argument: ArgumentCommandTree<S, V, *, R>): B {
require(argument is SimpleArgumentCommandTree) { "Argument trees must be made with ArgumentCommandTree.builder()" }

Expand All @@ -190,9 +184,6 @@ internal sealed class SimpleCommandTree<S, V : HList<V>, R>(
override fun <NV> setArgument(parameter: Parameter<S, V, NV>, init: ArgumentCommandTree.Builder<S, V, NV, R>.() -> Unit): B =
this.setArgument(ArgumentCommandTree.builder<S, V, NV, R>().setParameter(parameter).apply(init).build())

override fun <NV> setArgument(parameter: Parameter<S, V, NV>, init: Consumer<ArgumentCommandTree.Builder<S, V, NV, R>>): B =
this.setArgument(ArgumentCommandTree.builder<S, V, NV, R>().setParameter(parameter).apply { init.accept(this) }.build())

override fun setExecutor(executor: (S, V) -> R): B {
this.executor = executor
return this as B
Expand Down

0 comments on commit 0cfe6e6

Please sign in to comment.