#[repr(C)]pub struct BuildingData {
pub header: Header,
pub entity: Entity,
pub player: Entity,
pub item: ItemId,
pub kind: u8,
pub replay: u8,
pub template: [u8; 16],
pub position: [f32; 3],
}Expand description
The data of the BuildingPlaced and
BuildingRemoved events.
§Examples
use enshwick::abi::{BuildingData, Header};
let placed = BuildingData {
header: Header::of::<BuildingData>(),
entity: enshwick::Entity(4096),
player: enshwick::Entity(2),
item: enshwick::ItemId::new(1_302_084_846),
kind: BuildingData::PLACED,
replay: 0,
template: [0; 16],
position: [1.0, 2.0, 3.0],
};
assert_eq!(placed.kind, BuildingData::PLACED);Fields§
§header: HeaderSize and version of this struct.
entity: EntityThe placed entity; for a removal, the entity as it was.
player: EntityThe acting player’s character entity.
item: ItemIdThe item placed, which the entity keeps as its UsedItem; 0 for a
removal.
kind: u8§replay: u81 when undo or redo replayed the action.
template: [u8; 16]The template GUID of the placed entity, in file order; zero for a removal.
position: [f32; 3]Where it was placed, in metres; zero for a removal.
Implementations§
Trait Implementations§
Source§impl Clone for BuildingData
impl Clone for BuildingData
impl Copy for BuildingData
Source§impl Debug for BuildingData
impl Debug for BuildingData
impl Headed for BuildingData
Source§impl IntoScript for BuildingData
impl IntoScript for BuildingData
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Available on crate feature
unstable only.The value as
Typed::TY shapes it.Source§impl Typed for BuildingData
impl Typed for BuildingData
Auto Trait Implementations§
impl Freeze for BuildingData
impl RefUnwindSafe for BuildingData
impl Send for BuildingData
impl Sync for BuildingData
impl Unpin for BuildingData
impl UnsafeUnpin for BuildingData
impl UnwindSafe for BuildingData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more