aboutsummaryrefslogtreecommitdiff
path: root/src/payload/mod.rs
blob: 3639997098757ff5f86c0c943615194624c3e106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use serde::{Deserialize, Serialize};
use uuid::Uuid;

/// Payload components
pub mod components;

/// Payload steganographically embedded into asset files
#[derive(Serialize, Deserialize, Default, Clone, Debug)]
pub struct DirworldEntityPayload { 
    /// Unique identifier for this entity, used by conditional system
    pub id: Uuid,
    /// Transform of this entity
    pub transform: components::Transform,
    /// Name for this entity
    pub name: Option<components::Name>,
    /// Actor information for this entity
    pub actor: Option<components::Actor>,
    /// Voice information for this entity
    pub voice: Option<components::Voice>,
    /// Rigidbody for this entity
    pub rigidbody: Option<components::Rigidbody>,
    /// Mesh collider information for this entity
    pub mesh_collider: Option<components::MeshCollider>,
    /// Lua scripts for this entity
    pub scripts: Option<Vec<components::Script>>,
    /// Relationships for this entity
    pub relationships: Option<components::Relationships>,
    /// Pickup information for this entity
    pub pickup: Option<components::Pickup>,
    /// Door destination
    pub door_destination: Option<components::DoorDestination>,
}

impl DirworldEntityPayload {
    /// Create a new default payload with a randomized UUID
    pub fn new() -> Self {
        Self {
            id: Uuid::new_v4(),
            ..Default::default()
        }
    }
}