artifacts/models/
npc_schema.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct NpcSchema {
7    /// Name of the NPC.
8    #[serde(rename = "name")]
9    pub name: String,
10    /// The code of the NPC. This is the NPC's unique identifier (ID).
11    #[serde(rename = "code")]
12    pub code: String,
13    /// Description of the NPC.
14    #[serde(rename = "description")]
15    pub description: String,
16    /// Type of the NPC.
17    #[serde(rename = "type")]
18    pub r#type: models::NpcType,
19}
20
21impl NpcSchema {
22    pub fn new(
23        name: String,
24        code: String,
25        description: String,
26        r#type: models::NpcType,
27    ) -> NpcSchema {
28        NpcSchema {
29            name,
30            code,
31            description,
32            r#type,
33        }
34    }
35}