2018-09-06 03:04:07 +00:00
|
|
|
package com.github.insanusmokrassar.PsychomatrixBase.presentation.presenters.DefaultRealisations
|
|
|
|
|
|
|
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.ModifyPsychomatrixUseCase
|
|
|
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.PsychomatrixOperationIsConvert
|
2018-09-07 13:54:19 +00:00
|
|
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.MutablePsychomatrix
|
2018-09-06 03:04:07 +00:00
|
|
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.Psychomatrix
|
2018-09-07 14:24:54 +00:00
|
|
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.operations.Operation
|
2018-09-06 03:04:07 +00:00
|
|
|
import com.github.insanusmokrassar.PsychomatrixBase.presentation.presenters.ModifyPsychomatrixPresenter
|
2019-03-15 02:54:38 +00:00
|
|
|
import kotlinx.coroutines.channels.ReceiveChannel
|
2018-09-06 03:04:07 +00:00
|
|
|
|
|
|
|
class ModifyPsychomatrixPresenterImpl(
|
|
|
|
private val modifyPsychomatrixUseCase: ModifyPsychomatrixUseCase
|
|
|
|
) : ModifyPsychomatrixPresenter {
|
|
|
|
|
|
|
|
override fun openPsychomatrixChangedSubscription(): ReceiveChannel<PsychomatrixOperationIsConvert> {
|
|
|
|
return modifyPsychomatrixUseCase.openPsychomatrixChangedSubscription()
|
|
|
|
}
|
|
|
|
|
2018-09-07 14:21:52 +00:00
|
|
|
override fun makeConvert(psychomatrix: MutablePsychomatrix, operation: Operation): Boolean {
|
2018-09-07 12:36:55 +00:00
|
|
|
return modifyPsychomatrixUseCase.makeConvert(psychomatrix, operation)
|
|
|
|
}
|
|
|
|
|
2018-09-07 14:21:52 +00:00
|
|
|
override fun makeInvert(psychomatrix: MutablePsychomatrix, operation: Operation): Boolean {
|
2018-09-07 14:11:54 +00:00
|
|
|
return modifyPsychomatrixUseCase.makeInvert(psychomatrix, operation)
|
2018-09-06 03:04:07 +00:00
|
|
|
}
|
|
|
|
|
2018-09-07 14:21:52 +00:00
|
|
|
override fun getConverts(psychomatrix: Psychomatrix): List<Operation> {
|
2018-09-07 14:11:54 +00:00
|
|
|
return modifyPsychomatrixUseCase.getConverts(psychomatrix)
|
2018-09-06 03:04:07 +00:00
|
|
|
}
|
|
|
|
|
2018-09-07 14:21:52 +00:00
|
|
|
override fun getInverts(psychomatrix: Psychomatrix): List<Operation> {
|
2018-09-07 14:11:54 +00:00
|
|
|
return modifyPsychomatrixUseCase.getInverts(psychomatrix)
|
2018-09-06 03:04:07 +00:00
|
|
|
}
|
|
|
|
|
2018-09-07 14:21:52 +00:00
|
|
|
override fun getPsychomatrixHistory(psychomatrix: Psychomatrix): List<Operation> {
|
2018-09-08 11:28:36 +00:00
|
|
|
return modifyPsychomatrixUseCase.getPsychomatrixHistory(psychomatrix)
|
2018-09-06 03:04:07 +00:00
|
|
|
}
|
|
|
|
}
|