add early logic of net computing on value setting

dev_raz_wip
Laurent 7 years ago
parent 58284b7e6b
commit 05b9ae094d
  1. 21
      app/src/main/java/net/pokeranalytics/android/model/realm/Result.kt

@ -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?
}
Loading…
Cancel
Save