Added temporary domain objects

This commit is contained in:
Nacho 2025-01-04 16:42:50 +01:00
parent e9eedb7429
commit 2f4bc9dba6
7 changed files with 146 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package com.github.nacabaro.vbhelper.daos
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.github.nacabaro.vbhelper.domain.Dim
import kotlinx.coroutines.flow.Flow
@Dao
interface DiMDao {
@Insert
suspend fun insertNewDim(dim: Dim)
@Query("SELECT * FROM Dim")
fun getAllDims(): Flow<List<Dim>>
}

View File

@ -0,0 +1,11 @@
package com.github.nacabaro.vbhelper.daos
import androidx.room.Dao
import androidx.room.Upsert
import com.github.nacabaro.vbhelper.domain.DimProgress
@Dao
interface DiMProgressDao {
@Upsert
suspend fun updateDimProgress(vararg dimProgress: DimProgress)
}

View File

@ -0,0 +1,11 @@
package com.github.nacabaro.vbhelper.daos
import androidx.room.Dao
import androidx.room.Insert
import com.github.nacabaro.vbhelper.temporary_domain.TemporaryTransformationHistory
@Dao
interface UserMonstersTransformationHistoryDao {
@Insert
fun insertTransformations(vararg transformations: TemporaryTransformationHistory)
}

View File

@ -0,0 +1,4 @@
package com.github.nacabaro.vbhelper.dtos
class MonsterDataCombined {
}

View File

@ -0,0 +1,42 @@
package com.github.nacabaro.vbhelper.temporary_domain
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.PrimaryKey
import com.github.cfogrady.vbnfc.be.FirmwareVersion
import com.github.cfogrady.vbnfc.data.NfcCharacter
@Entity(
foreignKeys = [
ForeignKey(
entity = TemporaryCharacterData::class,
parentColumns = ["id"],
childColumns = ["userId"],
onDelete = ForeignKey.CASCADE
)
]
)
data class TemporaryBECharacterData (
@PrimaryKey(autoGenerate = true) val id: Int,
val trainingHp: UShort,
val trainingAp: UShort,
val trainingBp: UShort,
val remainingTrainingTimeInMinutes: UShort,
val itemEffectMentalStateValue: Byte,
val itemEffectMentalStateMinutesRemaining: Byte,
val itemEffectActivityLevelValue: Byte,
val itemEffectActivityLevelMinutesRemaining: Byte,
val itemEffectVitalPointsChangeValue: Byte,
val itemEffectVitalPointsChangeMinutesRemaining: Byte,
val abilityRarity: NfcCharacter.AbilityRarity,
val abilityType: UShort,
val abilityBranch: UShort,
val abilityReset: Byte,
val rank: Byte,
val itemType: Byte,
val itemMultiplier: Byte,
val itemRemainingTime: Byte,
val otp0: String,
val otp1: String,
var characterCreationFirmwareVersion: FirmwareVersion,
)

View File

@ -0,0 +1,49 @@
package com.github.nacabaro.vbhelper.temporary_domain
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.github.cfogrady.vbnfc.data.NfcCharacter
/*
dimId=16,
charIndex=8,
stage=4,
attribute=Free,
ageInDays=0,
nextAdventureMissionStage=9,
mood=99,
vitalPoints=9999,
transformationCountdown=1101,
injuryStatus=None,
trophies=0,
currentPhaseBattlesWon=19,
currentPhaseBattlesLost=4,
totalBattlesWon=36,
totalBattlesLost=10,
activityLevel=0,
heartRateCurrent=71,
*/
@Entity
data class TemporaryCharacterData (
@PrimaryKey(autoGenerate = true) val id: Int,
val dimId: UShort,
var charIndex: UShort,
var stage: Byte,
var attribute: NfcCharacter.Attribute,
var ageInDays: Byte,
var nextAdventureMissionStage: Byte, // next adventure mission stage on the character's dim
var mood: Byte,
var vitalPoints: UShort,
var transformationCountdown: UShort,
var injuryStatus: NfcCharacter.InjuryStatus,
var trophies: UShort,
var currentPhaseBattlesWon: UShort,
var currentPhaseBattlesLost: UShort,
var totalBattlesWon: UShort,
var totalBattlesLost: UShort,
var activityLevel: Byte,
var heartRateCurrent: UByte,
var transformationHistory: Int
)

View File

@ -0,0 +1,13 @@
package com.github.nacabaro.vbhelper.temporary_domain
import androidx.room.Entity
@Entity
// Bit lazy, will correct later...
data class TemporaryTransformationHistory (
val monId: Int,
val toCharIndex: Byte,
val yearsSince1988: Byte,
val month: Byte,
val day: Byte
)