Skip to content

Commit

Permalink
More style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GregHib committed Jan 22, 2024
1 parent 6196d76 commit a952ec8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package world.gregs.voidps.cache
import world.gregs.voidps.buffer.write.Writer

interface DefinitionEncoder<T : Definition> {
open fun Writer.encode(definition: T, members: T) {
fun Writer.encode(definition: T, members: T) {
encode(definition)
}

open fun Writer.encode(definition: T) {
fun Writer.encode(definition: T) {
encode(definition, definition)
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
package world.gregs.voidps.cache.definition.data

data class InterfaceComponentSetting(var setting: Int, var anInt7413: Int) {
fun method2743(): Int {
return setting and 0x3fda8 shr 11
}

fun method2744(): Boolean {
return 0x1 and setting shr 22 != 0
}

fun method2745(): Int {
return 0x1d36c1 and setting shr 18
}

fun method2746(): Boolean {
return 0x1 and setting != 0
}

fun method2747(): Boolean {
return 0x1 and setting shr 21 != 0
}

fun unlockedSlot(slot: Int): Boolean {
return 0x1 and setting shr slot + 1 != 0
}
}
data class InterfaceComponentSetting(var setting: Int, var anInt7413: Int)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import world.gregs.voidps.cache.definition.data.WorldMapIconDefinition
class WorldMapIconDecoder : DefinitionDecoder<WorldMapIconDefinition>(WORLD_MAP) {

private var archive = -1
var aBoolean1313 = false
private var aBoolean1313 = false

override fun getArchive(id: Int) = archive

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class ItemEncoder : DefinitionEncoder<ItemDefinitionFull> {
val floorOptions = definition.floorOptions
for (index in 0 until 5) {
val option = floorOptions[index]
if ((index == 5 && option == "Examine") || (index == 2 && option == "Take") || option == null) {
if ((index == 2 && option == "Take") || option == null) {
continue
}
writeByte(30 + index)
Expand Down
3 changes: 0 additions & 3 deletions types/src/main/kotlin/world/gregs/voidps/type/Direction.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package world.gregs.voidps.type

import world.gregs.voidps.type.Delta
import world.gregs.voidps.type.equals

enum class Direction(deltaX: Int, deltaY: Int) {
NORTH_WEST(-1, 1),
NORTH(0, 1),
Expand Down

0 comments on commit a952ec8

Please sign in to comment.