Terminadas funciones en yaku15.kt

master
Araozu 2020-10-20 21:58:59 -05:00
parent 7ae3231493
commit 3f22a5ce3d
1 changed files with 38 additions and 1 deletions

View File

@ -1,13 +1,50 @@
package dev.araozu.juego.yaku package dev.araozu.juego.yaku
import dev.araozu.juego.CartaDragon
import dev.araozu.juego.ContenedorGrupos import dev.araozu.juego.ContenedorGrupos
internal fun yakuDragonesFull(contenedorGrupos: ContenedorGrupos): Boolean { 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 return false
} }
internal fun yakuVerde(contenedorGrupos: ContenedorGrupos): Boolean { 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
} }