|
|
|
@ -35,6 +35,8 @@ import net.pokeranalytics.android.util.* |
|
|
|
import java.util.* |
|
|
|
import java.util.* |
|
|
|
import java.util.Currency |
|
|
|
import java.util.Currency |
|
|
|
import kotlin.collections.ArrayList |
|
|
|
import kotlin.collections.ArrayList |
|
|
|
|
|
|
|
import kotlin.properties.Delegates |
|
|
|
|
|
|
|
import kotlin.reflect.KProperty |
|
|
|
|
|
|
|
|
|
|
|
open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepresentableDataSource, RowRepresentable, |
|
|
|
open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepresentableDataSource, RowRepresentable, |
|
|
|
Timed { |
|
|
|
Timed { |
|
|
|
@ -55,7 +57,7 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PrimaryKey |
|
|
|
@PrimaryKey |
|
|
|
var id = UUID.randomUUID().toString() |
|
|
|
override var id = UUID.randomUUID().toString() |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Indicates the type of session, cash game or tournament |
|
|
|
* Indicates the type of session, cash game or tournament |
|
|
|
@ -109,6 +111,11 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
* The start date of the break |
|
|
|
* The start date of the break |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
override var pauseDate: Date? = null |
|
|
|
override var pauseDate: Date? = null |
|
|
|
|
|
|
|
set(value) { |
|
|
|
|
|
|
|
field = value |
|
|
|
|
|
|
|
this.updateRowRepresentation() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The time frame of the Session, i.e. the start & end date |
|
|
|
// The time frame of the Session, i.e. the start & end date |
|
|
|
// var timeFrame: TimeFrame? = null |
|
|
|
// var timeFrame: TimeFrame? = null |
|
|
|
@ -185,6 +192,7 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
} else if (this.sessionSet != null) { |
|
|
|
} else if (this.sessionSet != null) { |
|
|
|
SessionSetManager.removeFromTimeline(this) |
|
|
|
SessionSetManager.removeFromTimeline(this) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.updateRowRepresentation() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -460,15 +468,14 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
@Ignore |
|
|
|
@Ignore |
|
|
|
override val viewType: Int = RowViewType.ROW_SESSION.ordinal |
|
|
|
override val viewType: Int = RowViewType.ROW_SESSION.ordinal |
|
|
|
|
|
|
|
|
|
|
|
override fun uniqueIdentifier(): String { |
|
|
|
|
|
|
|
return this.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun getDisplayName(): String { |
|
|
|
override fun getDisplayName(): String { |
|
|
|
return "Session ${this.creationDate}" |
|
|
|
return "Session ${this.creationDate}" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
@Ignore |
|
|
|
|
|
|
|
private var rowRepresentationForCurrentState : List<RowRepresentable> = this.updatedRowRepresentationForCurrentState() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun updatedRowRepresentationForCurrentState(): List<RowRepresentable> { |
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
|
|
|
|
|
|
|
|
// Headers |
|
|
|
// Headers |
|
|
|
@ -509,8 +516,6 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
//TODO V2: Add Bankroll variation |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
if (!isTournament()) { |
|
|
|
if (!isTournament()) { |
|
|
|
rows.add( |
|
|
|
rows.add( |
|
|
|
CustomizableRowRepresentable( |
|
|
|
CustomizableRowRepresentable( |
|
|
|
@ -520,8 +525,6 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rows.add(SeparatorRowRepresentable()) |
|
|
|
rows.add(SeparatorRowRepresentable()) |
|
|
|
} |
|
|
|
} |
|
|
|
else -> { |
|
|
|
else -> { |
|
|
|
@ -533,6 +536,15 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
return rows |
|
|
|
return rows |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun updateRowRepresentation() { |
|
|
|
|
|
|
|
this.rowRepresentationForCurrentState = this.updatedRowRepresentationForCurrentState() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
|
|
|
|
return this.rowRepresentationForCurrentState |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun boolForRow(row: RowRepresentable): Boolean { |
|
|
|
override fun boolForRow(row: RowRepresentable): Boolean { |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|