commonMain.mahjongutils.entry.Main.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mahjong-utils-entry-jvm Show documentation
Show all versions of mahjong-utils-entry-jvm Show documentation
Provider a union entry for Mahjong Utils (for Japanese Riichi Mahjong)
The newest version!
@file:JvmName("MainEntryBuilder")
package mahjongutils.entry
import mahjongutils.entry.coder.ParamsDecoder
import mahjongutils.entry.coder.ResultEncoder
import mahjongutils.entry.models.HanHu
import mahjongutils.hanhu.ChildPoint
import mahjongutils.hanhu.ParentPoint
import mahjongutils.hanhu.getChildPointByHanHu
import mahjongutils.hanhu.getParentPointByHanHu
import mahjongutils.hora.Hora
import mahjongutils.hora.HoraArgs
import mahjongutils.hora.hora
import mahjongutils.shanten.*
import kotlin.jvm.JvmName
internal fun buildEntry(
paramsDecoder: ParamsDecoder,
resultEncoder: ResultEncoder
): Entry {
return Entry(paramsDecoder, resultEncoder).apply {
register("shanten") { args ->
shanten(args)
}
register("regularShanten") { args ->
regularShanten(args)
}
register("chitoiShanten") { args ->
chitoiShanten(args)
}
register("kokushiShanten") { args ->
kokushiShanten(args)
}
register("furoChanceShanten") { args ->
furoChanceShanten(args)
}
register("getParentPointByHanHu") { args ->
getParentPointByHanHu(args.han, args.hu, args.options)
}
register("getChildPointByHanHu") { args ->
getChildPointByHanHu(args.han, args.hu, args.options)
}
register("hora") { args ->
hora(args)
}
}
}