From c40a4de99dbd30ba4ea7aea705a178d16d9483a8 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 7 Sep 2018 21:10:07 +0800 Subject: [PATCH] one more fix for operations --- .../domain/entities/operations/Operation.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/operations/Operation.kt b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/operations/Operation.kt index 942645e..970e7d1 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/operations/Operation.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/operations/Operation.kt @@ -1,7 +1,5 @@ package com.github.insanusmokrassar.PsychomatrixBase.domain.entities.operations -import java.io.IOException - private const val oneAsByte: Byte = 1 private const val twoAsByte: Byte = 2 private const val fourAsByte: Byte = 4 @@ -11,8 +9,6 @@ private const val sevenAsByte: Byte = 7 private const val eightAsByte: Byte = 8 private const val nineAsByte: Byte = 9 -class ConverterException: IOException("This converter can't convert input numbers") - val List.canGrowSimpleWay: Boolean get() = contains(SixGrowSeven) @@ -33,12 +29,12 @@ private val operations: List = listOf( }.toTypedArray() ) -suspend fun availableConverts(numbers: MutableList, operations: List): List { - return operations.filter { it.canConvert(numbers, operations) } +suspend fun availableConverts(numbers: MutableList, history: List): List { + return operations.filter { it.canConvert(numbers, history) } } -suspend fun availableInverts(numbers: MutableList, operations: List): List { - return operations.filter { it.canInvert(numbers, operations) } +suspend fun availableInverts(numbers: MutableList, history: List): List { + return operations.filter { it.canInvert(numbers, history) } } sealed class Operation {