mirror of
https://github.com/InsanusMokrassar/PsychomatrixBase.git
synced 2024-11-14 20:33:57 +00:00
architecture fixes
This commit is contained in:
parent
2d2ee91c61
commit
15f0b19ee6
@ -46,7 +46,7 @@ class ModifyPsychomatrixUseCaseInteractor : ModifyPsychomatrixUseCase {
|
||||
|
||||
private fun asMutablePsychomatrix(psychomatrix: Psychomatrix): MutablePsychomatrix {
|
||||
return currentPsychomatrixes.firstOrNull {
|
||||
it == psychomatrix
|
||||
it.date == psychomatrix.date
|
||||
} ?: MutablePsychomatrix(psychomatrix).also {
|
||||
currentPsychomatrixes.add(it)
|
||||
}
|
||||
|
@ -33,6 +33,10 @@ class ModifyPsychomatrixPresenterImpl(
|
||||
return modifyPsychomatrixUseCase.openPsychomatrixChangedSubscription()
|
||||
}
|
||||
|
||||
override suspend fun tryToDoOperation(psychomatrix: Psychomatrix, operation: Operation): Deferred<Boolean> {
|
||||
return modifyPsychomatrixUseCase.makeConvert(psychomatrix, operation)
|
||||
}
|
||||
|
||||
override suspend fun twoGrowFourAvailable(psychomatrix: Psychomatrix): Deferred<Boolean> {
|
||||
return async {
|
||||
(availableConverts[psychomatrix] ?: updateConvertsOfPsychomatrix(psychomatrix)).contains(TwoGrowFour)
|
||||
|
@ -11,6 +11,8 @@ interface ModifyPsychomatrixPresenter {
|
||||
|
||||
fun openPsychomatrixChangedSubscription(): ReceiveChannel<PsychomatrixOperationIsConvert>
|
||||
|
||||
suspend fun tryToDoOperation(psychomatrix: Psychomatrix, operation: Operation): Deferred<Boolean>
|
||||
|
||||
suspend fun twoGrowFourAvailable(psychomatrix: Psychomatrix): Deferred<Boolean>
|
||||
suspend fun fourGrowTwoAvailable(psychomatrix: Psychomatrix): Deferred<Boolean>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user