From fdfd55cdb7cc77e756d93f8ff25f5300abfb65fa Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 7 Sep 2018 21:30:59 +0800 Subject: [PATCH] update equals of Psychomatrix --- .../github/insanusmokrassar/PsychomatrixBase/Example.kt | 9 +++++++++ .../PsychomatrixBase/domain/entities/Psychomatrix.kt | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/Example.kt b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/Example.kt index 6105437..0164f2e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/Example.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/Example.kt @@ -1,4 +1,13 @@ package com.github.insanusmokrassar.PsychomatrixBase +import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.MutablePsychomatrix +import com.github.insanusmokrassar.PsychomatrixBase.domain.entities.operations.TwoGrowFour +import kotlinx.coroutines.experimental.runBlocking +import org.joda.time.DateTime + fun main(args: Array) { + val psychomatrix = MutablePsychomatrix(DateTime.now().withDate(2022, 12, 22)) + runBlocking { + println(psychomatrix.availableOperations.await()) + } } diff --git a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/Psychomatrix.kt b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/Psychomatrix.kt index f88c2ad..0093c4e 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/Psychomatrix.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/PsychomatrixBase/domain/entities/Psychomatrix.kt @@ -186,4 +186,8 @@ open class Psychomatrix(val date: DateTime) { getDownDiagSum() ) } + + override fun equals(other: Any?): Boolean { + return super.equals(other) || (other as? Psychomatrix) ?.date == date + } }