mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-07-13 07:24:53 +00:00
another constructor
This commit is contained in:
parent
f0bc64d338
commit
ffa935e7d3
1 changed files with 13 additions and 2 deletions
|
|
@ -35,10 +35,10 @@ object TargetInfo {
|
||||||
*/
|
*/
|
||||||
private def rangedFloat(n : Int) : Float = {
|
private def rangedFloat(n : Int) : Float = {
|
||||||
(
|
(
|
||||||
(if(n < 0) {
|
(if(n <= 0) {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
else if(n > 255) {
|
else if(n >= 255) {
|
||||||
255
|
255
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -59,6 +59,17 @@ object TargetInfo {
|
||||||
val unk2_2 : Float = rangedFloat(unk2)
|
val unk2_2 : Float = rangedFloat(unk2)
|
||||||
TargetInfo(target_guid, unk1_2, unk2_2)
|
TargetInfo(target_guid, unk1_2, unk2_2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overloaded constructor that takes `Integer` values rather than `Float` values and assumes the second `Integer` is zero.
|
||||||
|
* @param target_guid the target
|
||||||
|
* @param unk na
|
||||||
|
* @return a `TargetInfo` object
|
||||||
|
*/
|
||||||
|
def apply(target_guid : PlanetSideGUID, unk : Int) : TargetInfo = {
|
||||||
|
val unk1_2 : Float = rangedFloat(unk)
|
||||||
|
TargetInfo(target_guid, unk1_2, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object TargetingInfoMessage extends Marshallable[TargetingInfoMessage] {
|
object TargetingInfoMessage extends Marshallable[TargetingInfoMessage] {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue