public static void SpawnEmptyVendorFromTemplate(StatelData statelData, IPlayfield playfield, int instance) { Identity pfIdentity = new Identity() { Type = IdentityType.Playfield, Instance = statelData.PlayfieldId }; Identity freeIdentity = new Identity() { Type = IdentityType.VendingMachine, Instance = Pool.Instance.GetFreeInstance<Vendor>( 0x70000000, IdentityType.VendingMachine) }; Vendor v = new Vendor(pfIdentity, freeIdentity, statelData.TemplateId); v.OriginalIdentity = statelData.Identity; v.RawCoordinates = new Vector3(statelData.X, statelData.Y, statelData.Z); v.Heading = new Quaternion( statelData.HeadingX, statelData.HeadingY, statelData.HeadingZ, statelData.HeadingW); v.Playfield = playfield; }
public static void SpawnVendorFromDatabaseTemplate(DBVendor vendor, IPlayfield playfield) { Identity pfIdentity = new Identity() { Type = IdentityType.Playfield, Instance = vendor.Playfield }; Identity freeIdentity = new Identity() { Type = IdentityType.VendingMachine, Instance = Pool.Instance.GetFreeInstance<Vendor>( 0x70000000, IdentityType.VendingMachine) }; Vendor v = new Vendor(pfIdentity, freeIdentity, vendor.Hash); v.RawCoordinates = new Vector3(vendor.X, vendor.Y, vendor.Z); v.Heading = new Quaternion(vendor.HeadingX, vendor.HeadingY, vendor.HeadingZ, vendor.HeadingW); v.Playfield = playfield; }