mirror of
https://github.com/InsanusMokrassar/PsychomatrixBase.git
synced 2024-11-14 20:33:57 +00:00
fixes
This commit is contained in:
parent
7e7d00881f
commit
4b534b6b16
@ -9,8 +9,7 @@ open class UseCasesDIImpl(
|
|||||||
entitiesDI: EntitiesDI
|
entitiesDI: EntitiesDI
|
||||||
) : UseCasesDI, EntitiesDI by entitiesDI {
|
) : UseCasesDI, EntitiesDI by entitiesDI {
|
||||||
|
|
||||||
val calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase by lazy {
|
override val calculatePsychomatrixByDateUseCase: CalculatePsychomatrixByDateUseCase by lazy {
|
||||||
CalculatePsychomatrixByDateUseCaseInteractor()
|
CalculatePsychomatrixByDateUseCaseInteractor()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import kotlinx.coroutines.experimental.channels.ReceiveChannel
|
|||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
interface CalculatePsychomatrixByDate {
|
interface CalculatePsychomatrixByDateUseCase {
|
||||||
suspend fun calculate(date: Long): Deferred<Psychomatrix>
|
suspend fun calculate(date: Long): Deferred<Psychomatrix>
|
||||||
suspend fun calculate(date: DateTime): Deferred<Psychomatrix>
|
suspend fun calculate(date: DateTime): Deferred<Psychomatrix>
|
||||||
suspend fun calculate(date: Date): Deferred<Psychomatrix>
|
suspend fun calculate(date: Date): Deferred<Psychomatrix>
|
||||||
|
@ -17,19 +17,21 @@ class MutablePsychomatrix(date: DateTime) : Psychomatrix(date) {
|
|||||||
|
|
||||||
constructor(psychomatrix: Psychomatrix): this(psychomatrix.date)
|
constructor(psychomatrix: Psychomatrix): this(psychomatrix.date)
|
||||||
|
|
||||||
val operationsHistory: List<Operation>
|
val operationsHistory: Deferred<List<Operation>>
|
||||||
get() = mutableOperationsHistory
|
get() = async {
|
||||||
|
mutableOperationsHistory
|
||||||
|
}
|
||||||
|
|
||||||
val availableOperations: Deferred<List<Operation>>
|
val availableOperations: Deferred<List<Operation>>
|
||||||
get() = async {
|
get() = async {
|
||||||
availableConverts.await().plus(availableInverts.await())
|
availableConverts.await().plus(availableInverts.await())
|
||||||
}
|
}
|
||||||
|
|
||||||
private val availableConverts: Deferred<List<Operation>>
|
val availableConverts: Deferred<List<Operation>>
|
||||||
get() = async {
|
get() = async {
|
||||||
availableConverts(mutableNumbers, mutableOperationsHistory)
|
availableConverts(mutableNumbers, mutableOperationsHistory)
|
||||||
}
|
}
|
||||||
private val availableInverts: Deferred<List<Operation>>
|
val availableInverts: Deferred<List<Operation>>
|
||||||
get() = async {
|
get() = async {
|
||||||
availableInverts(mutableNumbers, mutableOperationsHistory)
|
availableInverts(mutableNumbers, mutableOperationsHistory)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.github.insanusmokrassar.PsychomatrixBase.domain.interactors
|
package com.github.insanusmokrassar.PsychomatrixBase.domain.interactors
|
||||||
|
|
||||||
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDate
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.UseCases.CalculatePsychomatrixByDateUseCase
|
||||||
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.Psychomatrix
|
import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.Psychomatrix
|
||||||
import com.github.insanusmokrassar.PsychomatrixBase.utils.extensions.SUBSCRIPTIONS_MEDIUM
|
import com.github.insanusmokrassar.PsychomatrixBase.utils.extensions.SUBSCRIPTIONS_MEDIUM
|
||||||
import kotlinx.coroutines.experimental.Deferred
|
import kotlinx.coroutines.experimental.Deferred
|
||||||
@ -10,7 +10,7 @@ import kotlinx.coroutines.experimental.channels.ReceiveChannel
|
|||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class CalculatePsychomatrixByDateInteractor : CalculatePsychomatrixByDate {
|
class CalculatePsychomatrixByDateUseCaseInteractor : CalculatePsychomatrixByDateUseCase {
|
||||||
private val psychomatrixCreatedBroadcast = BroadcastChannel<Psychomatrix>(SUBSCRIPTIONS_MEDIUM)
|
private val psychomatrixCreatedBroadcast = BroadcastChannel<Psychomatrix>(SUBSCRIPTIONS_MEDIUM)
|
||||||
|
|
||||||
override suspend fun calculate(date: Long): Deferred<Psychomatrix> {
|
override suspend fun calculate(date: Long): Deferred<Psychomatrix> {
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
package com.github.insanusmokrassar.PsychomatrixBase.presentation.presenters
|
||||||
|
|
||||||
|
interface PsychomatrixChangerPresenter {
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user