mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-05 05:00:20 +00:00
repaired some broken tests; LoadoutManager respects length; squad ids attempt to reset only when no players are logged in
This commit is contained in:
parent
35a8d87941
commit
0c105f3826
6 changed files with 75 additions and 73 deletions
|
|
@ -11,7 +11,7 @@ class LoadoutManager(size : Int) {
|
|||
|
||||
def SaveLoadout(owner : Any, label : String, line : Int) : Unit = {
|
||||
Loadout.Create(owner, label) match {
|
||||
case Success(loadout) =>
|
||||
case Success(loadout) if entries.length > line =>
|
||||
entries(line) = Some(loadout)
|
||||
case _ => ;
|
||||
}
|
||||
|
|
@ -20,7 +20,9 @@ class LoadoutManager(size : Int) {
|
|||
def LoadLoadout(line : Int) : Option[Loadout] = entries.lift(line).flatten
|
||||
|
||||
def DeleteLoadout(line : Int) : Unit = {
|
||||
entries(line) = None
|
||||
if(entries.length > line) {
|
||||
entries(line) = None
|
||||
}
|
||||
}
|
||||
|
||||
def Loadouts : Seq[(Int, Loadout)] = entries.zipWithIndex.collect { case(Some(loadout), index) => (index, loadout) } toSeq
|
||||
|
|
|
|||
|
|
@ -152,11 +152,11 @@ class SquadService extends Actor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the unique squad identifier back to the start (1) if no squads are active.
|
||||
* Set the unique squad identifier back to the start (1) if no squads are active and no players are logged on.
|
||||
* @return `true`, if the identifier is reset; `false`, otherwise
|
||||
*/
|
||||
def TryResetSquadId() : Boolean = {
|
||||
if(squadFeatures.isEmpty) {
|
||||
if(UserEvents.isEmpty && squadFeatures.isEmpty) {
|
||||
sid = 1
|
||||
true
|
||||
}
|
||||
|
|
@ -2451,7 +2451,6 @@ class SquadService extends Actor {
|
|||
squadFeatures.remove(guid).get.Stop,
|
||||
None
|
||||
)
|
||||
TryResetSquadId()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2652,6 +2651,7 @@ class SquadService extends Actor {
|
|||
UserEvents.remove(charId)
|
||||
}
|
||||
SquadEvents.unsubscribe(sender) //just to make certain
|
||||
TryResetSquadId()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (7-1)" in {
|
||||
PacketCoding.DecodePacket(string_71).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.Disband
|
||||
unk1 mustEqual SquadResponseType.PlatoonInvite
|
||||
unk2 mustEqual 2
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 1176612L
|
||||
|
|
@ -222,7 +222,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (7-2)" in {
|
||||
PacketCoding.DecodePacket(string_72).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.Disband
|
||||
unk1 mustEqual SquadResponseType.PlatoonInvite
|
||||
unk2 mustEqual 0
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 41578085L
|
||||
|
|
@ -238,7 +238,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (8-1)" in {
|
||||
PacketCoding.DecodePacket(string_81).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.PlatoonInvite
|
||||
unk1 mustEqual SquadResponseType.PlatoonAccept
|
||||
unk2 mustEqual 0
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 30910985L
|
||||
|
|
@ -254,7 +254,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (9-1)" in {
|
||||
PacketCoding.DecodePacket(string_91).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.PlatoonAccept
|
||||
unk1 mustEqual SquadResponseType.PlatoonReject
|
||||
unk2 mustEqual 0
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 297025L
|
||||
|
|
@ -270,7 +270,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (9-2)" in {
|
||||
PacketCoding.DecodePacket(string_92).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.PlatoonAccept
|
||||
unk1 mustEqual SquadResponseType.PlatoonReject
|
||||
unk2 mustEqual 0
|
||||
unk3 mustEqual 0
|
||||
unk4 mustEqual 30910985L
|
||||
|
|
@ -286,7 +286,7 @@ class SquadMembershipResponseTest extends Specification {
|
|||
"decode (b-1)" in {
|
||||
PacketCoding.DecodePacket(string_b1).require match {
|
||||
case SquadMembershipResponse(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8) =>
|
||||
unk1 mustEqual SquadResponseType.PlatoonCancel
|
||||
unk1 mustEqual SquadResponseType.PlatoonLeave
|
||||
unk2 mustEqual 0
|
||||
unk3 mustEqual 1
|
||||
unk4 mustEqual 30910985L
|
||||
|
|
@ -377,42 +377,42 @@ class SquadMembershipResponseTest extends Specification {
|
|||
}
|
||||
|
||||
"encode (7-1)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.Disband, 2, 0, 1176612L, Some(0L), "", true, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonInvite, 2, 0, 1176612L, Some(0L), "", true, Some(None))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_71
|
||||
}
|
||||
|
||||
"encode (7-2)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.Disband, 0, 0, 41578085L, Some(30910985L), "Wizkid45", true, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonInvite, 0, 0, 41578085L, Some(30910985L), "Wizkid45", true, Some(None))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_72
|
||||
}
|
||||
|
||||
"encode (8-1)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonInvite, 0, 0, 30910985L, Some(41578085L), "Wizkid45", false, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonAccept, 0, 0, 30910985L, Some(41578085L), "Wizkid45", false, Some(None))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_81
|
||||
}
|
||||
|
||||
"encode (9-1)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonAccept, 0, 0, 297025L, Some(41605002L), "", true, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonReject, 0, 0, 297025L, Some(41605002L), "", true, Some(None))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_91
|
||||
}
|
||||
|
||||
"encode (9-2)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonAccept, 0, 0, 30910985L, Some(41578085L), "Wizkid45", false, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonReject, 0, 0, 30910985L, Some(41578085L), "Wizkid45", false, Some(None))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_92
|
||||
}
|
||||
|
||||
"encode (b-1)" in {
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonCancel, 0, 1, 30910985L, Some(41578085L), "SAraisVanu", false, Some(None))
|
||||
val msg = SquadMembershipResponse(SquadResponseType.PlatoonLeave, 0, 1, 30910985L, Some(41578085L), "SAraisVanu", false, Some(None))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_b1
|
||||
|
|
|
|||
|
|
@ -121,19 +121,19 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(0).Active mustEqual false
|
||||
obj.Implants(0).Implant mustEqual ImplantType.None
|
||||
obj.Implant(0) mustEqual ImplantType.None
|
||||
obj.Implants(0).Installed mustEqual None
|
||||
obj.Implants(0).Installed.isEmpty mustEqual true
|
||||
obj.Implants(1).Unlocked mustEqual false
|
||||
obj.Implants(1).Initialized mustEqual false
|
||||
obj.Implants(1).Active mustEqual false
|
||||
obj.Implants(1).Implant mustEqual ImplantType.None
|
||||
obj.Implant(1) mustEqual ImplantType.None
|
||||
obj.Implants(1).Installed mustEqual None
|
||||
obj.Implants(1).Installed.isEmpty mustEqual true
|
||||
obj.Implants(2).Unlocked mustEqual false
|
||||
obj.Implants(2).Initialized mustEqual false
|
||||
obj.Implants(2).Active mustEqual false
|
||||
obj.Implants(2).Implant mustEqual ImplantType.None
|
||||
obj.Implant(2) mustEqual ImplantType.None
|
||||
obj.Implants(2).Installed mustEqual None
|
||||
obj.Implants(2).Installed.isEmpty mustEqual true
|
||||
|
||||
obj.Implant(3) mustEqual ImplantType.None //invalid slots beyond the third always reports as ImplantType.None
|
||||
}
|
||||
|
|
@ -142,10 +142,10 @@ class AvatarTest extends Specification {
|
|||
val testplant : ImplantDefinition = ImplantDefinition(1)
|
||||
val obj = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.Implants(0).Unlocked = true
|
||||
obj.InstallImplant(testplant) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant).contains(0) mustEqual true
|
||||
obj.Implants.find({p => p.Implant == ImplantType(1)}) match { //find the installed implant
|
||||
case Some(slot) =>
|
||||
slot.Installed mustEqual Some(testplant)
|
||||
slot.Installed.contains(testplant) mustEqual true
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
|
@ -159,8 +159,8 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(0).Unlocked = true
|
||||
obj.Implants(1).Unlocked = true
|
||||
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).contains(1) mustEqual true
|
||||
}
|
||||
|
||||
"can not install the same type of implant twice" in {
|
||||
|
|
@ -170,8 +170,8 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(0).Unlocked = true
|
||||
obj.Implants(1).Unlocked = true
|
||||
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual None
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"can not install more implants than slots available (two unlocked)" in {
|
||||
|
|
@ -182,9 +182,9 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(0).Unlocked = true
|
||||
obj.Implants(1).Unlocked = true
|
||||
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant3) mustEqual None
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).contains(1) mustEqual true
|
||||
obj.InstallImplant(testplant3).isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"can not install more implants than slots available (four implants)" in {
|
||||
|
|
@ -197,21 +197,21 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(1).Unlocked = true
|
||||
obj.Implants(2).Unlocked = true
|
||||
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant3) mustEqual Some(2)
|
||||
obj.InstallImplant(testplant4) mustEqual None
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).contains(1) mustEqual true
|
||||
obj.InstallImplant(testplant3).contains(2) mustEqual true
|
||||
obj.InstallImplant(testplant4).isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"can uninstall an implant" in {
|
||||
val testplant : ImplantDefinition = ImplantDefinition(1)
|
||||
val obj = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.Implants(0).Unlocked = true
|
||||
obj.InstallImplant(testplant) mustEqual Some(0)
|
||||
obj.Implants(0).Installed mustEqual Some(testplant)
|
||||
obj.InstallImplant(testplant).contains(0) mustEqual true
|
||||
obj.Implants(0).Installed.contains(testplant) mustEqual true
|
||||
|
||||
obj.UninstallImplant(testplant.Type) mustEqual Some(0)
|
||||
obj.Implants(0).Installed mustEqual None
|
||||
obj.UninstallImplant(testplant.Type).contains(0) mustEqual true
|
||||
obj.Implants(0).Installed.isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"can uninstall just a specific implant" in {
|
||||
|
|
@ -222,14 +222,14 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(0).Unlocked = true
|
||||
obj.Implants(1).Unlocked = true
|
||||
obj.Implants(2).Unlocked = true
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant3) mustEqual Some(2)
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).contains(1) mustEqual true
|
||||
obj.InstallImplant(testplant3).contains(2) mustEqual true
|
||||
|
||||
obj.Implant(0) mustEqual testplant1.Type
|
||||
obj.Implant(1) mustEqual testplant2.Type
|
||||
obj.Implant(2) mustEqual testplant3.Type
|
||||
obj.UninstallImplant(testplant2.Type) mustEqual Some(1)
|
||||
obj.UninstallImplant(testplant2.Type).contains(1) mustEqual true
|
||||
obj.Implant(0) mustEqual testplant1.Type
|
||||
obj.Implant(1) mustEqual ImplantType.None
|
||||
obj.Implant(2) mustEqual testplant3.Type
|
||||
|
|
@ -243,16 +243,16 @@ class AvatarTest extends Specification {
|
|||
obj.Implants(0).Unlocked = true
|
||||
obj.Implants(1).Unlocked = true
|
||||
obj.Implants(2).Unlocked = true
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant3) mustEqual Some(2)
|
||||
obj.UninstallImplant(testplant2.Type) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).contains(1) mustEqual true
|
||||
obj.InstallImplant(testplant3).contains(2) mustEqual true
|
||||
obj.UninstallImplant(testplant2.Type).contains(1) mustEqual true
|
||||
obj.Implant(0) mustEqual testplant1.Type
|
||||
obj.Implant(1) mustEqual ImplantType.None
|
||||
obj.Implant(2) mustEqual testplant3.Type
|
||||
|
||||
val testplant4 : ImplantDefinition = ImplantDefinition(4)
|
||||
obj.InstallImplant(testplant4) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant4).contains(1) mustEqual true
|
||||
obj.Implant(0) mustEqual testplant1.Type
|
||||
obj.Implant(1) mustEqual testplant4.Type
|
||||
obj.Implant(2) mustEqual testplant3.Type
|
||||
|
|
@ -264,8 +264,8 @@ class AvatarTest extends Specification {
|
|||
val obj = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.Implants(0).Unlocked = true
|
||||
obj.Implants(1).Unlocked = true
|
||||
obj.InstallImplant(testplant1) mustEqual Some(0)
|
||||
obj.InstallImplant(testplant2) mustEqual Some(1)
|
||||
obj.InstallImplant(testplant1).contains(0) mustEqual true
|
||||
obj.InstallImplant(testplant2).contains(1) mustEqual true
|
||||
obj.Implants(0).Initialized = true
|
||||
obj.Implants(0).Active = true
|
||||
obj.Implants(1).Initialized = true
|
||||
|
|
@ -281,7 +281,7 @@ class AvatarTest extends Specification {
|
|||
|
||||
"does not have any loadout specifications by default" in {
|
||||
val (_, avatar) = CreatePlayer()
|
||||
(0 to 9).foreach { avatar.EquipmentLoadouts.LoadLoadout(_) mustEqual None }
|
||||
(0 to 9).foreach { avatar.EquipmentLoadouts.LoadLoadout(_).isEmpty mustEqual true }
|
||||
ok
|
||||
}
|
||||
|
||||
|
|
@ -337,9 +337,9 @@ class AvatarTest extends Specification {
|
|||
|
||||
"try to save player's current inventory as a loadout, but will not save to an invalid slot" in {
|
||||
val (obj, avatar) = CreatePlayer()
|
||||
avatar.EquipmentLoadouts.SaveLoadout(obj, "test", 10)
|
||||
avatar.EquipmentLoadouts.SaveLoadout(obj, "test", 50)
|
||||
|
||||
avatar.EquipmentLoadouts.LoadLoadout(10) mustEqual None
|
||||
avatar.EquipmentLoadouts.LoadLoadout(50).isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"save player's current inventory as a loadout, without inventory contents" in {
|
||||
|
|
@ -384,7 +384,7 @@ class AvatarTest extends Specification {
|
|||
|
||||
avatar.EquipmentLoadouts.LoadLoadout(0).isDefined mustEqual true
|
||||
avatar.EquipmentLoadouts.DeleteLoadout(0)
|
||||
avatar.EquipmentLoadouts.LoadLoadout(0) mustEqual None
|
||||
avatar.EquipmentLoadouts.LoadLoadout(0).isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"the fifth slot is the locker wrapped in an EquipmentSlot" in {
|
||||
|
|
|
|||
|
|
@ -245,34 +245,34 @@ class PlayerTest extends Specification {
|
|||
val obj = TestPlayer("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.Slot(-1).Equipment = wep
|
||||
|
||||
obj.Slot(-1).Equipment mustEqual None
|
||||
obj.Slot(-1).Equipment.isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"search for the smallest available slot in which to store equipment" in {
|
||||
val obj = TestPlayer("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.Inventory.Resize(3,3) //fits one item
|
||||
|
||||
obj.Fit(Tool(GlobalDefinitions.beamer)) mustEqual Some(0)
|
||||
obj.Fit(Tool(GlobalDefinitions.beamer)).contains(0) mustEqual true
|
||||
|
||||
obj.Fit(Tool(GlobalDefinitions.suppressor)) mustEqual Some(2)
|
||||
obj.Fit(Tool(GlobalDefinitions.suppressor)).contains(2) mustEqual true
|
||||
|
||||
val ammo = AmmoBox(GlobalDefinitions.bullet_9mm)
|
||||
val ammo2 = AmmoBox(GlobalDefinitions.bullet_9mm)
|
||||
val ammo3 = AmmoBox(GlobalDefinitions.bullet_9mm)
|
||||
obj.Fit(ammo) mustEqual Some(6)
|
||||
obj.Fit(ammo).contains(6) mustEqual true
|
||||
obj.Slot(6).Equipment = ammo
|
||||
obj.Fit(ammo2) mustEqual Some(Player.FreeHandSlot)
|
||||
obj.Fit(ammo2).contains(Player.FreeHandSlot) mustEqual true
|
||||
obj.Slot(Player.FreeHandSlot).Equipment = ammo2
|
||||
obj.Fit(ammo3) mustEqual None
|
||||
obj.Fit(ammo3).isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"can use their free hand to hold things" in {
|
||||
val obj = TestPlayer("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
val ammo = AmmoBox(GlobalDefinitions.bullet_9mm)
|
||||
obj.FreeHand.Equipment mustEqual None
|
||||
obj.FreeHand.Equipment.isEmpty mustEqual true
|
||||
|
||||
obj.FreeHand.Equipment = ammo
|
||||
obj.FreeHand.Equipment mustEqual Some(ammo)
|
||||
obj.FreeHand.Equipment.contains(ammo) mustEqual true
|
||||
}
|
||||
|
||||
"can access the player's locker-space" in {
|
||||
|
|
@ -308,12 +308,12 @@ class PlayerTest extends Specification {
|
|||
item
|
||||
}
|
||||
|
||||
obj.Find(PlanetSideGUID(1)) mustEqual Some(0) //holsters
|
||||
obj.Find(PlanetSideGUID(2)) mustEqual Some(4) //holsters, melee
|
||||
obj.Find(PlanetSideGUID(3)) mustEqual Some(6) //inventory
|
||||
obj.Find(PlanetSideGUID(4)) mustEqual None //can not find in locker-space
|
||||
obj.Find(PlanetSideGUID(5)) mustEqual Some(Player.FreeHandSlot) //free hand
|
||||
obj.Find(PlanetSideGUID(6)) mustEqual None //not here
|
||||
obj.Find(PlanetSideGUID(1)).contains(0) mustEqual true //holsters
|
||||
obj.Find(PlanetSideGUID(2)).contains(4) mustEqual true //holsters, melee
|
||||
obj.Find(PlanetSideGUID(3)).contains(6) mustEqual true //inventory
|
||||
obj.Find(PlanetSideGUID(4)).isEmpty mustEqual true //can not find in locker-space
|
||||
obj.Find(PlanetSideGUID(5)).contains(Player.FreeHandSlot) mustEqual true //free hand
|
||||
obj.Find(PlanetSideGUID(6)).isEmpty mustEqual true //not here
|
||||
}
|
||||
|
||||
"does equipment collision checking (are we already holding something there?)" in {
|
||||
|
|
@ -437,20 +437,20 @@ class PlayerTest extends Specification {
|
|||
|
||||
"seat in a vehicle" in {
|
||||
val obj = TestPlayer("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.VehicleSeated mustEqual None
|
||||
obj.VehicleSeated.isEmpty mustEqual true
|
||||
obj.VehicleSeated = PlanetSideGUID(65)
|
||||
obj.VehicleSeated mustEqual Some(PlanetSideGUID(65))
|
||||
obj.VehicleSeated.contains(PlanetSideGUID(65)) mustEqual true
|
||||
obj.VehicleSeated = None
|
||||
obj.VehicleSeated mustEqual None
|
||||
obj.VehicleSeated.isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"own in a vehicle" in {
|
||||
val obj = TestPlayer("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
obj.VehicleOwned mustEqual None
|
||||
obj.VehicleOwned.isEmpty mustEqual true
|
||||
obj.VehicleOwned = PlanetSideGUID(65)
|
||||
obj.VehicleOwned mustEqual Some(PlanetSideGUID(65))
|
||||
obj.VehicleOwned.contains(PlanetSideGUID(65)) mustEqual true
|
||||
obj.VehicleOwned = None
|
||||
obj.VehicleOwned mustEqual None
|
||||
obj.VehicleOwned.isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"remember what zone he is in" in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue