All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.mahjongutils.entry.Main.kt Maven / Gradle / Ivy

There is a newer version: 0.7.3
Show 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)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy