From 9f6927cb8ae747454ec634ab61d705754cd18218 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 20 Mar 2023 18:06:08 +0700 Subject: [PATCH] Multiplication of matter values --- .../kotlin/ru/dbotthepony/mc/otm/matter/IMatterValue.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/IMatterValue.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/IMatterValue.kt index ffe05bf75..ab6fb81d8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/IMatterValue.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/IMatterValue.kt @@ -28,6 +28,14 @@ interface IMatterValue : Comparable { return MatterValue(matter - other.matter, complexity - other.complexity) } + operator fun times(other: IMatterValue): IMatterValue { + return MatterValue(matter * other.matter, complexity * other.complexity) + } + + operator fun times(other: Int): IMatterValue { + return MatterValue(matter * other, complexity * other) + } + override fun compareTo(other: IMatterValue): Int { val matterComparison = matter.compareTo(other.matter)