Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
712 B
25 lines
712 B
package dev.openrs2.deob.analysis
|
|
|
|
import org.objectweb.asm.tree.analysis.BasicValue
|
|
import org.objectweb.asm.tree.analysis.Value
|
|
|
|
sealed class IntValue : Value {
|
|
data class Unknown(override val basicValue: BasicValue) : IntValue()
|
|
data class Constant(override val basicValue: BasicValue, val values: Set<Int>) : IntValue() {
|
|
val singleton: Int?
|
|
|
|
init {
|
|
require(values.isNotEmpty())
|
|
|
|
singleton = if (values.size == 1) values.first() else null
|
|
}
|
|
|
|
constructor(basicValue: BasicValue, value: Int) : this(basicValue, setOf(value))
|
|
}
|
|
|
|
abstract val basicValue: BasicValue
|
|
|
|
override fun getSize(): Int {
|
|
return basicValue.size
|
|
}
|
|
}
|
|
|