Added comments to the model

dev_raz_wip
Laurent 7 years ago
parent e02b1f6253
commit 955f396e90
  1. 14
      app/src/main/java/net/pokeranalytics/android/model/realm/Bankroll.kt
  2. 8
      app/src/main/java/net/pokeranalytics/android/model/realm/Currency.kt
  3. 11
      app/src/main/java/net/pokeranalytics/android/model/realm/CustomField.kt
  4. 13
      app/src/main/java/net/pokeranalytics/android/model/realm/Filter.kt
  5. 8
      app/src/main/java/net/pokeranalytics/android/model/realm/Game.kt
  6. 7
      app/src/main/java/net/pokeranalytics/android/model/realm/HandHistory.kt
  7. 11
      app/src/main/java/net/pokeranalytics/android/model/realm/Location.kt
  8. 7
      app/src/main/java/net/pokeranalytics/android/model/realm/Player.kt
  9. 11
      app/src/main/java/net/pokeranalytics/android/model/realm/Report.kt
  10. 24
      app/src/main/java/net/pokeranalytics/android/model/realm/Result.kt
  11. 51
      app/src/main/java/net/pokeranalytics/android/model/realm/Session.kt
  12. 9
      app/src/main/java/net/pokeranalytics/android/model/realm/TimeFrame.kt
  13. 7
      app/src/main/java/net/pokeranalytics/android/model/realm/TimeFrameGroup.kt
  14. 6
      app/src/main/java/net/pokeranalytics/android/model/realm/TournamentFeature.kt
  15. 8
      app/src/main/java/net/pokeranalytics/android/model/realm/TournamentName.kt
  16. 20
      app/src/main/java/net/pokeranalytics/android/model/realm/Transaction.kt
  17. 19
      app/src/main/java/net/pokeranalytics/android/model/realm/TransactionType.kt

@ -2,13 +2,25 @@ package net.pokeranalytics.android.model.realm
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Bankroll(name: String = "") : RealmObject() {
var live: Boolean = true
@PrimaryKey
var id = UUID.randomUUID().toString()
// the name of the bankroll
var name: String = name
// Indicates whether the bankroll is live or online
var live: Boolean = true
// The list of transactions of the bankroll
var transactions: RealmList<Transaction> = RealmList()
// The currency of the bankroll
var currency: Currency? = null
// @todo rate management

@ -1,11 +1,19 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Currency : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The currency code of the currency, i.e. USD, EUR...
var code: String? = null
// The rate of the currency with the main currency
var rate: Double? = null
}

@ -1,10 +1,19 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class CustomField : RealmObject() {
// @todo
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the currency field
var name: String = ""
// @todo
}

@ -2,19 +2,24 @@ package net.pokeranalytics.android.model.realm
import io.realm.MutableRealmInteger
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
//import net.pokeranalytics.android.FilterComponent
open class Filter : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// the filter name
var name: String = ""
// see https://realm.io/docs/java/latest/#counters
// the number of use of the filter,
// for MutableRealmInteger, see https://realm.io/docs/java/latest/#counters
val usageCount: MutableRealmInteger = MutableRealmInteger.valueOf(0)
// var components: List<FilterComponent> = listOf()
}

@ -1,10 +1,18 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Game : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the game
var name: String = ""
// A shorter name for the game
var shortName: String? = null
}

@ -1,11 +1,16 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class HandHistory : RealmObject() {
// @todo
@PrimaryKey
var id = UUID.randomUUID().toString()
// the date of the hand history
var date: Date = Date()
}

@ -1,11 +1,22 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Location : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the location
var name: String = ""
// the longitude of the location
var longitude: Double? = null
// the latitude of the location
var latitude: Double? = null
}

@ -1,8 +1,15 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Player : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the player
var name: String = ""
}

@ -2,6 +2,8 @@ package net.pokeranalytics.android.model.realm
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
enum class ReportDisplay {
TABLE,
@ -10,13 +12,22 @@ enum class ReportDisplay {
}
open class Report : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the report
var name: String = ""
// The type of display of the report
var display: Int = ReportDisplay.TABLE.ordinal
// @todo define the configuration options
// var comparators: List<Int> = listOf()
// var stats: List<Int> = listOf()
// The filters associated with the report
var filters: RealmList<Filter> = RealmList()
}

@ -2,19 +2,35 @@ package net.pokeranalytics.android.model.realm
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Result : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// the user associated to this session result
var player: Player? = null
// The buyin amount
var buyin: Double? = null
// the cashed out amount
var cashout: Double? = null
// The net result
var netResult: Double? = null
// The net (readonly)
var net: Double? = null
// The transactions associated with the Result, impacting the result
var transactions: RealmList<Transaction> = RealmList()
// @todo tips?
var finalPosition: Int? = null
// The tournament final position, if applicable
var tournamentFinalPosition: Int? = null
// var player: Player? = null
// @todo tips?
}

@ -15,46 +15,71 @@ import java.util.UUID.randomUUID
open class Session(comment: String = "") : RealmObject() {
// A comment written by the user
// The date of creation of the session
@PrimaryKey
var id = UUID.randomUUID().toString()
// The time frame of the Session, i.e. the start & end date
var timeFrame: TimeFrame? = null
// The time frame group, which can contain multiple sessions
var timeFrameGroup: TimeFrameGroup? = null
// the date of creation of the app
var creationDate: Date = Date()
// The limit type: NL, PL...
var limit: Int? = null
// The number of tables played at the same time
var numberOfTables: Int = 1
// The number of players at the table
var tableSize: Int? = null
// The game played during the Session
var game: Game? = null
// The bankroll hosting the results
var bankroll: Bankroll? = null
// The hands list associated with the Session
var hands: RealmList<HandHistory> = RealmList()
var timeFrame: TimeFrame? = null
var timeFrameGroup: TimeFrameGroup? = null
// the location where the session is played
var location: Location? = null
// The result of the main user
var result: Result? = null
// The list of opponents who participated to the session
var opponents: RealmList<Player> = RealmList()
// @todo serie
// A comment written by the user
var comment: String = ""
// Blinds
// Cash Game
// The small blind value
var cgSmallBlind: Double? = null
// The big blind value
var cgBigBlind: Double? = null
// Tournament
var entryFee: Double? = null
var numberOfPlayers: Int? = null
// The entry fee of the tournament
var tournamentEntryFee: Double? = null
// The total number of players who participated in the tournament
var tournamentNumberOfPlayers: Int? = null
// The name of the tournament
var tournamentType: TournamentName? = null
// The kind of the tournament, MTT or SnG
var tournamentKind: Int? = null
// The features of the tournament, like Knockout, Shootout, Turbo...
var tournamentFeatures: RealmList<TournamentFeature> = RealmList()
}

@ -1,15 +1,24 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class TimeFrame : RealmObject() {
// A start date
var startDate: Date = Date()
// An end date
var endDate: Date? = null
// The break duration
var breakDuration: Double = 0.0
// the total duration
var duration: Double = 0.0
// indicates a state of pause
var paused: Boolean = false
}

@ -2,13 +2,20 @@ package net.pokeranalytics.android.model.realm
import io.realm.RealmList
import io.realm.RealmObject
import io.realm.annotations.Ignore
import io.realm.annotations.PrimaryKey
import java.util.*
open class TimeFrameGroup() : RealmObject() {
// The timeframe of the group, i.e. its start & end date
var timeFrame: TimeFrame? = null
// The list of Session played within the group, i.e. played within the same time frame
var timeFrames: RealmList<Session> = RealmList()
@Ignore // a duration shortcut
var duration: Double = 0.0
}

@ -1,9 +1,15 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class TournamentFeature : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the feature
var name: String = ""
}

@ -1,14 +1,16 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class TournamentName() : RealmObject() {
// constructor() : this() {
//
// }
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the tournament
var name: String = ""
}

@ -1,18 +1,26 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class Transaction : RealmObject() {
var value: Double = 0.0
@PrimaryKey
var id = UUID.randomUUID().toString()
// The amount of the transaction
var amount: Double = 0.0
// The date of the transaction
var date: Date = Date()
var comment: String? = null
// The type of the transaction
var type: TransactionType? = null
}
// A user comment
var comment: String = ""
enum class TransactionKind {
WITHDRAWAL,
DEPOSIT
}

@ -1,13 +1,30 @@
package net.pokeranalytics.android.model.realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import java.util.*
open class TransactionType : RealmObject() {
@PrimaryKey
var id = UUID.randomUUID().toString()
// The name of the transaction type
var name: String = ""
// Whether or not the amount is added, or subtracted to the bankroll total
var additive: Boolean = false
// Whether or not the type can be deleted by the user
var lock: Boolean = false
// The predefined kind, if necessary, like: Withdrawal, deposit, or tips
var kind: Int? = null
}
}
enum class TransactionKind {
WITHDRAWAL,
DEPOSIT
}

Loading…
Cancel
Save