From 3f22a5ce3d0e4ba3998d35d77194d024411f9a4f Mon Sep 17 00:00:00 2001 From: Araozu Date: Tue, 20 Oct 2020 21:58:59 -0500 Subject: [PATCH] Terminadas funciones en yaku15.kt --- src/juego/yaku/yaku15.kt | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) 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 }