|
|
|
|
@ -16,21 +16,42 @@ open class Result : RealmObject() { |
|
|
|
|
|
|
|
|
|
// The buyin amount |
|
|
|
|
var buyin: Double? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
this.computeNet() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// the cashed out amount |
|
|
|
|
var cashout: Double? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
this.computeNet() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The net result |
|
|
|
|
var netResult: Double? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
this.computeNet() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The net (readonly) |
|
|
|
|
var net: Double? = null |
|
|
|
|
|
|
|
|
|
// The transactions associated with the Result, impacting the result |
|
|
|
|
var transactions: RealmList<Transaction> = RealmList() |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
this.computeNet() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The tournament final position, if applicable |
|
|
|
|
var tournamentFinalPosition: Int? = null |
|
|
|
|
|
|
|
|
|
// Computes the Net |
|
|
|
|
fun computeNet() { |
|
|
|
|
// this.net = ... |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @todo tips? |
|
|
|
|
} |