Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add combination runes, dungeoneering boxes and staves #520

Merged
merged 21 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import world.gregs.voidps.cache.definition.Extra
data class InterfaceComponentDefinition(
override var id: Int = -1,
var options: Array<String?>? = null,
var anObjectArray4758: Array<Any>? = null,
var information: Array<Any>? = null,
override var stringId: String = "",
override var extras: Map<String, Any>? = null
) : Definition, Extra {
Expand All @@ -21,18 +21,18 @@ data class InterfaceComponentDefinition(
if (other.options == null) return false
if (!options.contentEquals(other.options)) return false
} else if (other.options != null) return false
if (anObjectArray4758 != null) {
if (other.anObjectArray4758 == null) return false
if (!anObjectArray4758.contentEquals(other.anObjectArray4758)) return false
} else if (other.anObjectArray4758 != null) return false
if (information != null) {
if (other.information == null) return false
if (!information.contentEquals(other.information)) return false
} else if (other.information != null) return false
if (stringId != other.stringId) return false
return extras == other.extras
}

override fun hashCode(): Int {
var result = id
result = 31 * result + (options?.contentHashCode() ?: 0)
result = 31 * result + (anObjectArray4758?.contentHashCode() ?: 0)
result = 31 * result + (information?.contentHashCode() ?: 0)
result = 31 * result + stringId.hashCode()
result = 31 * result + (extras?.hashCode() ?: 0)
return result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ data class InterfaceComponentDefinitionFull(
var anInt4761: Int = -1,// Unused
var setting: InterfaceComponentSetting = InterfaceComponentSetting(0, -1),
val params: HashMap<Long, Any>? = null,
var anObjectArray4758: Array<Any>? = null,
var information: Array<Any>? = null,
var mouseEnterHandler: Array<Any>? = null,
var mouseExitHandler: Array<Any>? = null,
var anObjectArray4771: Array<Any>? = null,
Expand Down Expand Up @@ -197,10 +197,10 @@ data class InterfaceComponentDefinitionFull(
if (anInt4761 != other.anInt4761) return false
if (setting != other.setting) return false
if (params != other.params) return false
if (anObjectArray4758 != null) {
if (other.anObjectArray4758 == null) return false
if (!anObjectArray4758.contentEquals(other.anObjectArray4758)) return false
} else if (other.anObjectArray4758 != null) return false
if (information != null) {
if (other.information == null) return false
if (!information.contentEquals(other.information)) return false
} else if (other.information != null) return false
if (mouseEnterHandler != null) {
if (other.mouseEnterHandler == null) return false
if (!mouseEnterHandler.contentEquals(other.mouseEnterHandler)) return false
Expand Down Expand Up @@ -380,7 +380,7 @@ data class InterfaceComponentDefinitionFull(
result = 31 * result + anInt4761
result = 31 * result + setting.hashCode()
result = 31 * result + (params?.hashCode() ?: 0)
result = 31 * result + (anObjectArray4758?.contentHashCode() ?: 0)
result = 31 * result + (information?.contentHashCode() ?: 0)
result = 31 * result + (mouseEnterHandler?.contentHashCode() ?: 0)
result = 31 * result + (mouseExitHandler?.contentHashCode() ?: 0)
result = 31 * result + (anObjectArray4771?.contentHashCode() ?: 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ class InterfaceDecoder : DefinitionDecoder<InterfaceDefinition>(INTERFACES) {
if (setting and 0x3fda8 shr 11 != 0) {
buffer.skip(6)
}
anObjectArray4758 = decodeScript(buffer)
if (anObjectArray4758 != null) {
information = decodeScript(buffer)
if (information != null) {
empty = false
}
skipScript(buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class InterfaceDecoderFull : DefinitionDecoder<InterfaceDefinitionFull>(INTERFAC
}
}
this.setting = InterfaceComponentSetting(setting, settingData)
anObjectArray4758 = decodeScript(buffer)
information = decodeScript(buffer)
mouseEnterHandler = decodeScript(buffer)
mouseExitHandler = decodeScript(buffer)
anObjectArray4771 = decodeScript(buffer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class InterfaceEncoder : DefinitionEncoder<InterfaceComponentDefinitionFull> {
writeShort(definition.anInt4839)
}

encodeScript(definition.anObjectArray4758)
encodeScript(definition.information)
encodeScript(definition.mouseEnterHandler)
encodeScript(definition.mouseExitHandler)
encodeScript(definition.anObjectArray4771)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ internal class InterfaceEncoderTest {
setting = InterfaceComponentSetting(1234 or 0x3fda8, 567),
anInt4698 = 8910,
anInt4839 = 1112,
anObjectArray4758 = arrayOf(1, "two", 3, "four"),
information = arrayOf(1, "two", 3, "four"),
clientVarc = intArrayOf(5, 4, 3, 2, 1),
hasScript = true
)
Expand Down
Loading
Loading