Add Players

feature/top10
Aurelien Hubert 7 years ago
parent fffac5dd15
commit c25086757f
  1. 14
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt

@ -347,7 +347,7 @@ open class Session : RealmObject(), SessionInterface, Savable,
SessionRow.GAME -> getGameTitle()
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee?.toCurrency() ?: "--"
SessionRow.LOCATION -> location?.name ?: "--"
SessionRow.PLAYERS -> "TODO"
SessionRow.PLAYERS -> tournamentNumberOfPlayers?.toString() ?: "--"
SessionRow.POSITION -> result?.tournamentFinalPosition?.toString() ?: "--"
SessionRow.START_DATE -> if (timeFrame != null) timeFrame?.startDate?.shortDateTime() ?: "--" else "--"
SessionRow.TABLE_SIZE -> this.tableSize?.let { TableSize(it).localizedTitle(context) } ?: "--"
@ -442,10 +442,9 @@ open class Session : RealmObject(), SessionInterface, Savable,
// Add current location and locations list
data.add(RowRepresentableEditDescriptor(location, data = LiveData.LOCATION.items(realm)))
}
//TODO
SessionRow.PLAYERS -> {
data.add(
RowRepresentableEditDescriptor("", inputType = InputType.TYPE_CLASS_NUMBER)
RowRepresentableEditDescriptor(tournamentNumberOfPlayers?.toString(), inputType = InputType.TYPE_CLASS_NUMBER)
)
}
SessionRow.POSITION -> {
@ -456,12 +455,6 @@ open class Session : RealmObject(), SessionInterface, Savable,
)
)
}
//TODO
SessionRow.PRIZE -> {
data.add(
RowRepresentableEditDescriptor("", inputType = InputType.TYPE_CLASS_NUMBER)
)
}
SessionRow.TABLE_SIZE -> {
data.add(RowRepresentableEditDescriptor(tableSize))
}
@ -548,8 +541,7 @@ open class Session : RealmObject(), SessionInterface, Savable,
}
SessionRow.INITIAL_BUY_IN -> tournamentEntryFee = if (value == null) null else (value as String).toDouble()
SessionRow.LOCATION -> location = value as Location?
SessionRow.PLAYERS -> {
}//TODO
SessionRow.PLAYERS -> tournamentNumberOfPlayers = if (value != null) (value as String).toInt() else null
SessionRow.POSITION -> {
val localResult = if (result != null) result as Result else realm.createObject(Result::class.java)
localResult.tournamentFinalPosition = if (value == null) null else (value as String).toInt()

Loading…
Cancel
Save