Skip to content

Commit

Permalink
Remove type param on agentParams
Browse files Browse the repository at this point in the history
  • Loading branch information
chatasma committed May 17, 2024
1 parent 66079aa commit 8138365
Showing 1 changed file with 23 additions and 31 deletions.
54 changes: 23 additions & 31 deletions src/main/kotlin/database/models/Achievement.kt
Original file line number Diff line number Diff line change
Expand Up @@ -246,104 +246,96 @@ sealed class AchievementCategory {
}

@Serializable
sealed class AgentParams {
sealed class Agent {
@Serializable
@SerialName("TotalKillsAgentParams")
data class TotalKillsAgentParams(val targetKills: Int) : AgentParams()
data class TotalKillsAgentParams(val targetKills: Int) : Agent()

@Serializable
@SerialName("KillStreakAgentParams")
data class KillStreakAgentParams(val targetStreak: Int) : AgentParams()
data class KillStreakAgentParams(val targetStreak: Int) : Agent()

@Serializable
@SerialName("FireDeathAgentParams")
object FireDeathAgentParams : AgentParams()
object FireDeathAgentParams : Agent()

@Serializable
@SerialName("CaptureNoSprintAgentParams")
object CaptureNoSprintAgentParams : AgentParams()
object CaptureNoSprintAgentParams : Agent()

@Serializable
@SerialName("CompositeAgentParams")
data class CompositeAgentParams(val agents: List<Agent>) : AgentParams()
data class CompositeAgentParams(val agents: List<Agent>) : Agent()

@Serializable
@SerialName("ChatMessageAgentParams")
data class ChatMessageAgentParams(val message: String) : AgentParams()
data class ChatMessageAgentParams(val message: String) : Agent()

@Serializable
@SerialName("LevelUpAgentParams")
data class LevelUpAgentParams(val level: Int) : AgentParams()
data class LevelUpAgentParams(val level: Int) : Agent()

@Serializable
@SerialName("WoolCaptureAgentParams")
data class WoolCaptureAgentParams(val captures: Int) : AgentParams()
data class WoolCaptureAgentParams(val captures: Int) : Agent()

@Serializable
@SerialName("FirstBloodAgentParams")
data class FirstBloodAgentParams(val target: Int) : AgentParams()
data class FirstBloodAgentParams(val target: Int) : Agent()

@Serializable
@SerialName("BowDistanceAgentParams")
data class BowDistanceAgentParams(val distance: Long) : AgentParams()
data class BowDistanceAgentParams(val distance: Long) : Agent()

@Serializable
@SerialName("FlagCaptureAgentParams")
data class FlagCaptureAgentParams(val captures: Int) : AgentParams()
data class FlagCaptureAgentParams(val captures: Int) : Agent()

@Serializable
@SerialName("FlagDefendAgentParams")
data class FlagDefendAgentParams(val defends: Int) : AgentParams()
data class FlagDefendAgentParams(val defends: Int) : Agent()

@Serializable
@SerialName("WoolDefendAgentParams")
data class WoolDefendAgentParams(val defends: Int) : AgentParams()
data class WoolDefendAgentParams(val defends: Int) : Agent()

@Serializable
@SerialName("MonumentDamageAgentParams")
data class MonumentDamageAgentParams(val breaks: Int) : AgentParams()
data class MonumentDamageAgentParams(val breaks: Int) : Agent()

@Serializable
@SerialName("MonumentDestroyAgentParams")
data class MonumentDestroyAgentParams(val destroys: Int) : AgentParams()
data class MonumentDestroyAgentParams(val destroys: Int) : Agent()

@Serializable
@SerialName("KillConsecutiveAgentParams")
data class KillConsecutiveAgentParams(val seconds: Long, val kills: Int, val allWithin: Boolean) : AgentParams()
data class KillConsecutiveAgentParams(val seconds: Long, val kills: Int, val allWithin: Boolean) : Agent()

@Serializable
@SerialName("PlayTimeAgentParams")
data class PlayTimeAgentParams(val hours: Long) : AgentParams()
data class PlayTimeAgentParams(val hours: Long) : Agent()

@Serializable
@SerialName("RecordAgentParams")
data class RecordAgentParams<T : Number>(val recordType: RecordType, val threshold: T) : AgentParams()
data class RecordAgentParams<T : Number>(val recordType: RecordType, val threshold: T) : Agent()

@Serializable
@SerialName("ControlPointCaptureAgentParams")
data class ControlPointCaptureAgentParams(val captures: Int) : AgentParams()
data class ControlPointCaptureAgentParams(val captures: Int) : Agent()

@Serializable
@SerialName("TotalWinsAgentParams")
data class TotalWinsAgentParams(val wins: Int) : AgentParams()
data class TotalWinsAgentParams(val wins: Int) : Agent()

@Serializable
@SerialName("TotalDeathsAgentParams")
data class TotalDeathsAgentParams(val deaths: Int) : AgentParams()
data class TotalDeathsAgentParams(val deaths: Int) : Agent()

@Serializable
@SerialName("TotalLossesAgentParams")
data class TotalLossesAgentParams(val losses: Int) : AgentParams()
data class TotalLossesAgentParams(val losses: Int) : Agent()
}

@Serializable
data class Agent(
val type: AgentType,
@Contextual
@Serializable
val params: AgentParams? = null
)

@Serializable
data class AchievementStatistic(
val completionTime: Long
Expand Down

0 comments on commit 8138365

Please sign in to comment.