mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-23 16:43:43 +00:00
Building:
Replaces class object/serverobject/door/Base.scala. It performs nearly the exact same purpose but now has a list of owned objects called Amenities. Buildings are now a PlanetSideServerObject (PSSO), which allows them to have accept a *Control Actor and possess FactionAffinity. FoundationBuilder: FoundationBuilder : Building :: ServerObjectBuilder : [T <: PlanetSideServerObject] Amenity: Most PSSO's now accept Amenity as their parent in class hierarchy. Flagged PSSO's like Building and Vehicle are, on the other hand, capable of becoming the owner for these Amenity PSSOs, which allows them to inherit the same FactionAffinity. FactionAffinity: A trait that connects objects that are intended to communicate PlanetSideEmpire values. MountableBhevaior: Split between Mount and Dismount behavior. Passes appropriate messages to ensure coherent workflows. Control Actors: FactionAffinityBehavior and MountableBehavior are PartialFunctions that get processed in series. VehicleControl: Distinguished behavior allowed between an operational vehicle and a deactivated one. WSA: Tightened up DismountVehicleMsg handling code, since MountableBehavior has been enhanced. Minor: Shotgun shell stacking goes from 32 to 16. Various PSSO classes now have reliable Definition objects. Tests: We now have 1012 tests, some of them useful.
This commit is contained in:
parent
8c02f8d519
commit
eefe4d2e20
56 changed files with 1362 additions and 425 deletions
|
|
@ -5,10 +5,26 @@ import akka.actor.{Actor, Props}
|
|||
import net.psforever.objects.guid.NumberPoolHub
|
||||
import net.psforever.packet.game.PlanetSideGUID
|
||||
import net.psforever.objects.serverobject.ServerObjectBuilder
|
||||
import net.psforever.objects.serverobject.structures.{Building, FoundationBuilder}
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.types.Vector3
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
|
||||
class BuildingBuilderTest extends ActorTest {
|
||||
"Building object" should {
|
||||
"build" in {
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], 10, Zone.Nowhere), "building")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
assert(reply.isInstanceOf[Building])
|
||||
assert(reply.asInstanceOf[Building].Id == 10)
|
||||
assert(reply.asInstanceOf[Building].Zone == Zone.Nowhere)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DoorObjectBuilderTest1 extends ActorTest {
|
||||
import net.psforever.objects.serverobject.doors.Door
|
||||
"Door object" should {
|
||||
|
|
@ -150,4 +166,11 @@ object ServerObjectBuilderTest {
|
|||
sender ! builder.Build(context, hub)
|
||||
}
|
||||
}
|
||||
|
||||
class BuildingTestActor(building_id : Int, zone : Zone) extends Actor {
|
||||
def receive : Receive = {
|
||||
case _ =>
|
||||
sender ! FoundationBuilder(Building.Structure).Build(building_id, zone)(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue