pub struct MapEntity {Show 16 fields
pub class: String,
pub type_id: u32,
pub id: u32,
pub position: (f32, f32, f32),
pub rotation_yaw: f32,
pub health: f32,
pub health_max: f32,
pub states: Vec<String>,
pub script: Option<String>,
pub amount: u32,
pub parent_id: u32,
pub parent_class: u8,
pub links: Vec<u32>,
pub build_progress: u32,
pub unit_data: Option<UnitData>,
pub extensions: HashMap<String, String>,
}Expand description
An entity placed on the map.
Fields§
§class: StringEntity class: “object”, “building”, “item”, “unit”, “info”.
type_id: u32Type ID as defined in the content pack.
id: u32Unique numeric ID within the map.
position: (f32, f32, f32)World position. Y is explicit.
rotation_yaw: f32Yaw rotation in radians.
health: f32Current health.
health_max: f32Maximum health.
states: Vec<String>Initial state flags.
script: Option<String>Embedded script override.
amount: u32Item-specific: stack size.
parent_id: u32Parent entity ID (for items inside containers).
parent_class: u8Parent class (0=none, 1=obj, 2=unit, 3=item, 4=info).
links: Vec<u32>Linked entity IDs.
build_progress: u32Building-specific: construction progress 0–100.
unit_data: Option<UnitData>Unit-specific AI data.
extensions: HashMap<String, String>Additional custom data (extensions).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MapEntity
impl<'de> Deserialize<'de> for MapEntity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MapEntity
impl RefUnwindSafe for MapEntity
impl Send for MapEntity
impl Sync for MapEntity
impl Unpin for MapEntity
impl UnsafeUnpin for MapEntity
impl UnwindSafe for MapEntity
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