File tree Expand file tree Collapse file tree 3 files changed +31
-61
lines changed
socha-sdk/src/framework/sc/shared Expand file tree Collapse file tree 3 files changed +31
-61
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ data class PlayerScore(
2525 get() = parts.asList()
2626
2727 fun matches (definition : ScoreDefinition ): Boolean =
28- size() == definition.size()
28+ size() == definition.size
2929
3030 override fun equals (other : Any? ): Boolean =
3131 other is PlayerScore &&
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package sc.shared
2+
3+ import com.thoughtworks.xstream.annotations.XStreamAlias
4+ import com.thoughtworks.xstream.annotations.XStreamImplicit
5+
6+ @XStreamAlias(value = " scoreDefinition" )
7+ class ScoreDefinition (
8+ @XStreamImplicit(itemFieldName = " fragment" )
9+ private val fragments : MutableList <ScoreFragment > = ArrayList ()
10+ ): List<ScoreFragment> by fragments {
11+
12+ fun add (string : String ) =
13+ add(ScoreFragment (string))
14+
15+ fun add (fragment : ScoreFragment ) =
16+ fragments.add(fragment)
17+
18+ val isValid: Boolean
19+ get() = size > 0
20+
21+ override fun toString () =
22+ " ScoreDefinition[${fragments.joinToString()} ]"
23+
24+ override fun equals (other : Any? ): Boolean =
25+ other is ScoreDefinition && fragments == other.fragments
26+
27+ override fun hashCode () =
28+ fragments.hashCode()
29+
30+ }
You can’t perform that action at this time.
0 commit comments