diff --git a/src/juego/yaku/yaku15.kt b/src/juego/yaku/yaku15.kt index 7faefa1..9aec79d 100644 --- a/src/juego/yaku/yaku15.kt +++ b/src/juego/yaku/yaku15.kt @@ -1,13 +1,50 @@ package dev.araozu.juego.yaku +import dev.araozu.juego.CartaDragon import dev.araozu.juego.ContenedorGrupos internal fun yakuDragonesFull(contenedorGrupos: ContenedorGrupos): Boolean { + for (carrl in contenedorGrupos.seqs) { + for (c in carrl) { + if (c !is CartaDragon) return false + } + } + + for (carrl in contenedorGrupos.tris) { + for (c in carrl) { + if (c !is CartaDragon) return false + } + } + + for (carrl in contenedorGrupos.pares) { + for (c in carrl) { + if (c !is CartaDragon) return false + } + } + return false } internal fun yakuVerde(contenedorGrupos: ContenedorGrupos): Boolean { - return false + for (carrl in contenedorGrupos.seqs) { + for (c in carrl) { + if (!c.esCartaVerde()) return false + } + } + + for (carrl in contenedorGrupos.tris) { + for (c in carrl) { + if (!c.esCartaVerde()) return false + } + } + + for (carrl in contenedorGrupos.pares) { + for (c in carrl) { + if (!c.esCartaVerde()) return false + } + } + + return true }