Skip to main content

euv_engine/entity/
struct.rs

1use crate::*;
2
3/// The fundamental entity in the engine, combining a transform with
4/// a collection of behavior-defining components.
5#[derive(Clone, Data, New)]
6pub struct Entity {
7    /// The unique identifier of this entity.
8    #[get(type(copy))]
9    pub(crate) id: u64,
10    /// The human-readable name of this entity.
11    pub(crate) name: String,
12    /// The world-space transform (position, rotation, scale).
13    #[get(type(copy))]
14    #[get_mut(pub(crate))]
15    pub(crate) transform: Transform2D,
16    /// Whether this entity is active and should receive updates.
17    #[get(type(copy))]
18    pub(crate) active: bool,
19    /// The list of components attached to this entity.
20    #[get_mut(pub(crate))]
21    pub(crate) components: Vec<ComponentRc>,
22    /// Optional tags for grouping and querying entities.
23    #[get_mut(pub(crate))]
24    pub(crate) tags: Vec<String>,
25}