Skip to content

Commit

Permalink
Merge pull request #48 from Joshua-F/fix-ifsetobject
Browse files Browse the repository at this point in the history
fix: change IfSetObject count to Int
  • Loading branch information
Z-Kris authored Dec 20, 2024
2 parents 2db9a24 + 05ec39c commit 42804ae
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: CombinedId,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -26,7 +26,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId),
obj.toUShort(),
count.toUShort(),
count,
)

public val interfaceId: Int
Expand All @@ -35,8 +35,6 @@ public class IfSetObject private constructor(
get() = combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -48,15 +46,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: CombinedId,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -26,7 +26,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId),
obj.toUShort(),
count.toUShort(),
count,
)

public val interfaceId: Int
Expand All @@ -35,8 +35,6 @@ public class IfSetObject private constructor(
get() = combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -48,15 +46,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: Int,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -27,7 +27,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId).combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

public constructor(
Expand All @@ -37,7 +37,7 @@ public class IfSetObject private constructor(
) : this(
combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

private val _combinedId: CombinedId
Expand All @@ -48,8 +48,6 @@ public class IfSetObject private constructor(
get() = _combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -61,15 +59,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: Int,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -27,7 +27,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId).combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

public constructor(
Expand All @@ -37,7 +37,7 @@ public class IfSetObject private constructor(
) : this(
combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

private val _combinedId: CombinedId
Expand All @@ -48,8 +48,6 @@ public class IfSetObject private constructor(
get() = _combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -61,15 +59,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: Int,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -27,7 +27,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId).combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

public constructor(
Expand All @@ -37,7 +37,7 @@ public class IfSetObject private constructor(
) : this(
combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

private val _combinedId: CombinedId
Expand All @@ -48,8 +48,6 @@ public class IfSetObject private constructor(
get() = _combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -61,15 +59,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: Int,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -27,7 +27,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId).combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

public constructor(
Expand All @@ -37,7 +37,7 @@ public class IfSetObject private constructor(
) : this(
combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

private val _combinedId: CombinedId
Expand All @@ -48,8 +48,6 @@ public class IfSetObject private constructor(
get() = _combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -61,15 +59,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import net.rsprot.protocol.util.CombinedId
public class IfSetObject private constructor(
public val combinedId: Int,
private val _obj: UShort,
private val _count: UShort,
public val count: Int,
) : OutgoingGameMessage {
public constructor(
interfaceId: Int,
Expand All @@ -27,7 +27,7 @@ public class IfSetObject private constructor(
) : this(
CombinedId(interfaceId, componentId).combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

public constructor(
Expand All @@ -37,7 +37,7 @@ public class IfSetObject private constructor(
) : this(
combinedId,
obj.toUShort(),
count.toUShort(),
count,
)

private val _combinedId: CombinedId
Expand All @@ -48,8 +48,6 @@ public class IfSetObject private constructor(
get() = _combinedId.componentId
public val obj: Int
get() = _obj.toInt()
public val count: Int
get() = _count.toInt()
override val category: ServerProtCategory
get() = GameServerProtCategory.LOW_PRIORITY_PROT

Expand All @@ -61,15 +59,15 @@ public class IfSetObject private constructor(

if (combinedId != other.combinedId) return false
if (_obj != other._obj) return false
if (_count != other._count) return false
if (count != other.count) return false

return true
}

override fun hashCode(): Int {
var result = combinedId.hashCode()
result = 31 * result + _obj.hashCode()
result = 31 * result + _count.hashCode()
result = 31 * result + count.hashCode()
return result
}

Expand Down

0 comments on commit 42804ae

Please sign in to comment.