#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::actor_rpg::stats;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Abilities<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cha: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub con: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dex: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub int: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub str: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wis: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Attack<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub bonus: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub damage: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub damage_bonus: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub damage_type: Option<S>,
pub name: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Coinage<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ep: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub gp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sp: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Combat<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub ac: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_dice: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hit_dice_used: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub initiative: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub speed: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Conditions<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub death_saves: Option<stats::DeathSaves<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub exhaustion: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub inspiration: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CustomStat<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub min: Option<i64>,
pub name: S,
pub value: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CustomStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub stats: Option<Vec<stats::CustomStat<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub system_name: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub system_version: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccAbilities<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub agi: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub agi_base: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub int: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub luk: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub per: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sta: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sta_base: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub str: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub str_base: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccAttack<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_mod: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub damage: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub damage_bonus: Option<S>,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub notes: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub range: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccCleric<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub deity: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub disapproval_range: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub disapproval_table: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub holy_symbol: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub known_spells: Option<Vec<stats::DccClericSpell<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lay_on_hands_die: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_spell_level: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub spell_check_mod: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub turn_unholy_die: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unholy: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccClericSpell<S: BosStr = DefaultStr> {
pub level: i64,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub notes: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sinful: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccCoinage<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub gp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sp: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccCombat<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub ac: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub action_die: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_mod: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub crit_die: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub crit_table: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub fumble_die: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub initiative: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub speed: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccCorruption<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub effect: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub permanent: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccEquipment<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub armor: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub armor_check_penalty: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub gear: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub shield: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub trade_goods: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub treasure: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub weapons: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccHalfling<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub good_luck_charm: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub infravision: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub luck_spent_on_allies: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lucky_weapon: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sneak_and_hide: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub two_weapon_fighting: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccHp<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub current: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccIdentity<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub alignment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub class: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub level: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub occupation: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub xp: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccLuck<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub birth_augur: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub birth_augur_effect: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lucky_weapon: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub starting_luck: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccSaves<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub fort: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#ref: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub will: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccSpellburn<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub agi_burned: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub recovery_rate: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sta_burned: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub str_burned: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub abilities: Option<stats::DccAbilities<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub abilities_notes: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attacks: Option<Vec<stats::DccAttack<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cleric: Option<stats::DccCleric<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub coinage: Option<stats::DccCoinage<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub combat: Option<stats::DccCombat<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub equipment: Option<stats::DccEquipment<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub halfling: Option<stats::DccHalfling<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hp: Option<stats::DccHp<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub identity: Option<stats::DccIdentity<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub languages: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub luck: Option<stats::DccLuck<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub notes: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub saves: Option<stats::DccSaves<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thief: Option<stats::DccThief<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warrior: Option<stats::DccWarrior<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wizard: Option<stats::DccWizard<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccThief<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub alignment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub backstab: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lucky_weapon: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub skills: Option<stats::DccThiefSkills<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccThiefSkills<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub backstab: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cast_spell_from_scroll: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub climb_sheer_surfaces: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub disable_trap: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub disguise_self: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub find_trap: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub forge_document: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub handle_poison: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hide_in_shadows: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pick_lock: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pick_pocket: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub read_languages: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sneak_silently: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccWarrior<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub deed_die: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub infravision: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lucky_weapon: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mighty_deeds: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub shield_bash: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub smell_gold: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub underground_skills: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccWizard<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub corruption: Option<Vec<stats::DccCorruption<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub corruption_text: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub known_spells: Option<Vec<stats::DccWizardSpell<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_spell_level: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub patron: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub patron_bond: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub spell_check_mod: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub spellburn: Option<stats::DccSpellburn<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DccWizardSpell<S: BosStr = DefaultStr> {
pub level: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub lost: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mercurial_magic: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mercurial_roll: Option<i64>,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub notes: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DeathSaves<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub failures: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub successes: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DndStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub abilities: Option<stats::Abilities<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attacks: Option<Vec<stats::Attack<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub coinage: Option<stats::Coinage<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub combat: Option<stats::Combat<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub conditions: Option<stats::Conditions<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub equipment: Option<stats::Equipment<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub features: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hp: Option<stats::Hp<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub identity: Option<stats::Identity<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub languages: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub passives: Option<stats::Passives<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub personality: Option<stats::Personality<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub proficiencies: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub saves: Option<stats::Saves<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub skills: Option<stats::Skills<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub spellcasting: Option<stats::Spellcasting<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Equipment<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub armor: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub gear: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub treasure: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub weapons: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Hp<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub current: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub temp: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Identity<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub alignment: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub background: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub class: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub level: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub proficiency: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub race: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub xp: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "actor.rpg.stats",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Stats<S: BosStr = DefaultStr> {
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub custom: Option<stats::CustomStats<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dcc: Option<stats::DccStats<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dnd: Option<stats::DndStats<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub reverie: Option<stats::ReverieStats<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rmmz: Option<stats::RmmzStats<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct StatsGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Stats<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Passives<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub insight: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub investigation: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub perception: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Personality<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub backstory: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub bonds: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub flaws: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub ideals: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub traits: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ReverieStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub authority: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub entropy: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub liberty: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub oblivion: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub octant: Option<ReverieStatsOctant<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub receptive: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub skeptic: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReverieStatsOctant<S: BosStr = DefaultStr> {
Adaptive,
Chaotic,
Prepared,
Intended,
Contented,
Assertive,
Ordered,
Guarded,
Equilibrium,
Singling,
Confused,
Other(S),
}
impl<S: BosStr> ReverieStatsOctant<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Adaptive => "adaptive",
Self::Chaotic => "chaotic",
Self::Prepared => "prepared",
Self::Intended => "intended",
Self::Contented => "contented",
Self::Assertive => "assertive",
Self::Ordered => "ordered",
Self::Guarded => "guarded",
Self::Equilibrium => "equilibrium",
Self::Singling => "singling",
Self::Confused => "confused",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"adaptive" => Self::Adaptive,
"chaotic" => Self::Chaotic,
"prepared" => Self::Prepared,
"intended" => Self::Intended,
"contented" => Self::Contented,
"assertive" => Self::Assertive,
"ordered" => Self::Ordered,
"guarded" => Self::Guarded,
"equilibrium" => Self::Equilibrium,
"singling" => Self::Singling,
"confused" => Self::Confused,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ReverieStatsOctant<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ReverieStatsOctant<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ReverieStatsOctant<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ReverieStatsOctant<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ReverieStatsOctant<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ReverieStatsOctant<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ReverieStatsOctant<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ReverieStatsOctant::Adaptive => ReverieStatsOctant::Adaptive,
ReverieStatsOctant::Chaotic => ReverieStatsOctant::Chaotic,
ReverieStatsOctant::Prepared => ReverieStatsOctant::Prepared,
ReverieStatsOctant::Intended => ReverieStatsOctant::Intended,
ReverieStatsOctant::Contented => ReverieStatsOctant::Contented,
ReverieStatsOctant::Assertive => ReverieStatsOctant::Assertive,
ReverieStatsOctant::Ordered => ReverieStatsOctant::Ordered,
ReverieStatsOctant::Guarded => ReverieStatsOctant::Guarded,
ReverieStatsOctant::Equilibrium => ReverieStatsOctant::Equilibrium,
ReverieStatsOctant::Singling => ReverieStatsOctant::Singling,
ReverieStatsOctant::Confused => ReverieStatsOctant::Confused,
ReverieStatsOctant::Other(v) => ReverieStatsOctant::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct RmmzStats<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub agi: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub atk: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub class: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cri: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub def: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub eva: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub level: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub luk: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mat: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_hp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_mp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_tp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mdf: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tp: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub xp: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Saves<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cha: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub con: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dex: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub int: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub str: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wis: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Skills<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub acrobatics: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub animal_handling: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub arcana: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub athletics: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub deception: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub history: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub insight: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub intimidation: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub investigation: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub medicine: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub nature: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub perception: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub performance: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub persuasion: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub religion: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sleight_of_hand: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stealth: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub survival: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SpellList<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cantrips: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l1: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l2: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l3: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l4: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l5: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l6: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l7: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l8: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub l9: Option<Vec<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Spellcasting<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub ability: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attack: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub dc: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub slots: Option<Vec<stats::Spellslot<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub spells: Option<stats::SpellList<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Spellslot<S: BosStr = DefaultStr> {
pub level: i64,
pub total: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub used: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> Stats<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, StatsRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
impl<S: BosStr> LexiconSchema for Abilities<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"abilities"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.cha {
if *value > 30i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("cha"),
max: 30i64,
actual: *value,
});
}
}
if let Some(ref value) = self.cha {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("cha"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.con {
if *value > 30i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("con"),
max: 30i64,
actual: *value,
});
}
}
if let Some(ref value) = self.con {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("con"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.dex {
if *value > 30i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("dex"),
max: 30i64,
actual: *value,
});
}
}
if let Some(ref value) = self.dex {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("dex"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.int {
if *value > 30i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("int"),
max: 30i64,
actual: *value,
});
}
}
if let Some(ref value) = self.int {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("int"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str {
if *value > 30i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("str"),
max: 30i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("str"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.wis {
if *value > 30i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("wis"),
max: 30i64,
actual: *value,
});
}
}
if let Some(ref value) = self.wis {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("wis"),
min: 1i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Attack<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"attack"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.bonus {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("bonus"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.damage {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("damage"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.damage_type {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("damage_type"),
max: 30usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Coinage<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"coinage"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.cp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("cp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.ep {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("ep"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.gp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("gp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.pp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("pp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("sp"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Combat<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"combat"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.ac {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("ac"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.hit_dice {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("hit_dice"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.hit_dice_used {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("hit_dice_used"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.speed {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("speed"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Conditions<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"conditions"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.exhaustion {
if *value > 6i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("exhaustion"),
max: 6i64,
actual: *value,
});
}
}
if let Some(ref value) = self.exhaustion {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("exhaustion"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for CustomStat<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"customStat"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.category {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("category"),
max: 50usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 50usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for CustomStats<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"customStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.system_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("system_name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.system_version {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("system_version"),
max: 50usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccAbilities<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccAbilities"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.agi {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("agi"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.agi {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("agi"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.agi_base {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("agi_base"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.agi_base {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("agi_base"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.int {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("int"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.int {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("int"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.luk {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("luk"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.luk {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("luk"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.per {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("per"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.per {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("per"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sta {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("sta"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sta {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("sta"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sta_base {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("sta_base"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sta_base {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("sta_base"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("str"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("str"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str_base {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("str_base"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str_base {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("str_base"),
min: 1i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccAttack<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccAttack"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.attack_mod {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("attack_mod"),
max: 30usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.damage {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("damage"),
max: 30usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.damage_bonus {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("damage_bonus"),
max: 30usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.notes {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("notes"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.range {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("range"),
max: 30usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.r#type {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("type"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccCleric<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccCleric"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.deity {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("deity"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.disapproval_range {
if *value > 20i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("disapproval_range"),
max: 20i64,
actual: *value,
});
}
}
if let Some(ref value) = self.disapproval_range {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("disapproval_range"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.disapproval_table {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("disapproval_table"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.holy_symbol {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("holy_symbol"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.known_spells {
#[allow(unused_comparisons)]
if value.len() > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("known_spells"),
max: 50usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.lay_on_hands_die {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("lay_on_hands_die"),
max: 10usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.max_spell_level {
if *value > 5i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("max_spell_level"),
max: 5i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max_spell_level {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max_spell_level"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.turn_unholy_die {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("turn_unholy_die"),
max: 10usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccClericSpell<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccClericSpell"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.level;
if *value > 5i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("level"),
max: 5i64,
actual: *value,
});
}
}
{
let value = &self.level;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.notes {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("notes"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccCoinage<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccCoinage"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.cp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("cp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.gp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("gp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("sp"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccCombat<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccCombat"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.ac {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("ac"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.action_die {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("action_die"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.crit_die {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("crit_die"),
max: 10usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.crit_table {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("crit_table"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.fumble_die {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("fumble_die"),
max: 10usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.speed {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("speed"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccCorruption<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccCorruption"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.effect {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("effect"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.source {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("source"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.r#type {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("type"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccEquipment<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccEquipment"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.armor {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("armor"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.armor_check_penalty {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("armor_check_penalty"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.gear {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("gear"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.shield {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("shield"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.trade_goods {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("trade_goods"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.treasure {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("treasure"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.weapons {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("weapons"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccHalfling<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccHalfling"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.infravision {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("infravision"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.luck_spent_on_allies {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("luck_spent_on_allies"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.lucky_weapon {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("lucky_weapon"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccHp<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccHp"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.current {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("current"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max"),
min: 1i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccIdentity<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccIdentity"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.alignment {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("alignment"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.class {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("class"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.level {
if *value > 10i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("level"),
max: 10i64,
actual: *value,
});
}
}
if let Some(ref value) = self.level {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.occupation {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("occupation"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.title {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("title"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.xp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("xp"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccLuck<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccLuck"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.birth_augur {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("birth_augur"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.birth_augur_effect {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("birth_augur_effect"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.lucky_weapon {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("lucky_weapon"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.starting_luck {
if *value > 24i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("starting_luck"),
max: 24i64,
actual: *value,
});
}
}
if let Some(ref value) = self.starting_luck {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("starting_luck"),
min: 1i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccSaves<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccSaves"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccSpellburn<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccSpellburn"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.agi_burned {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("agi_burned"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.recovery_rate {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("recovery_rate"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.sta_burned {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("sta_burned"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.str_burned {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("str_burned"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccStats<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.abilities_notes {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("abilities_notes"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.attacks {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("attacks"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.languages {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("languages"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.notes {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 5000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("notes"),
max: 5000usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccThief<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccThief"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.alignment {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("alignment"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.backstab {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("backstab"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.lucky_weapon {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("lucky_weapon"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccThiefSkills<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccThiefSkills"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccWarrior<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccWarrior"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.deed_die {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("deed_die"),
max: 10usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.infravision {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("infravision"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.lucky_weapon {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("lucky_weapon"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.mighty_deeds {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("mighty_deeds"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.underground_skills {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("underground_skills"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccWizard<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccWizard"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.corruption {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("corruption"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.corruption_text {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("corruption_text"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.known_spells {
#[allow(unused_comparisons)]
if value.len() > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("known_spells"),
max: 50usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.max_spell_level {
if *value > 5i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("max_spell_level"),
max: 5i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max_spell_level {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max_spell_level"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.patron {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("patron"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.patron_bond {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("patron_bond"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DccWizardSpell<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dccWizardSpell"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.level;
if *value > 5i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("level"),
max: 5i64,
actual: *value,
});
}
}
{
let value = &self.level;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.mercurial_magic {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("mercurial_magic"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.mercurial_roll {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("mercurial_roll"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.mercurial_roll {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("mercurial_roll"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.notes {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("notes"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DeathSaves<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"deathSaves"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.failures {
if *value > 3i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("failures"),
max: 3i64,
actual: *value,
});
}
}
if let Some(ref value) = self.failures {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("failures"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.successes {
if *value > 3i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("successes"),
max: 3i64,
actual: *value,
});
}
}
if let Some(ref value) = self.successes {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("successes"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DndStats<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"dndStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.attacks {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("attacks"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.features {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 5000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("features"),
max: 5000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.languages {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("languages"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.proficiencies {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("proficiencies"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Equipment<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"equipment"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.armor {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("armor"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.gear {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("gear"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.treasure {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("treasure"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.weapons {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("weapons"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Hp<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"hp"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.current {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("current"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.temp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("temp"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Identity<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"identity"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.alignment {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("alignment"),
max: 50usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.background {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("background"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.class {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("class"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.level {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.proficiency {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("proficiency"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.race {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("race"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.xp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("xp"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct StatsRecord;
impl XrpcResp for StatsRecord {
const NSID: &'static str = "actor.rpg.stats";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = StatsGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<StatsGetRecordOutput<S>> for Stats<S> {
fn from(output: StatsGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Stats<S> {
const NSID: &'static str = "actor.rpg.stats";
type Record = StatsRecord;
}
impl Collection for StatsRecord {
const NSID: &'static str = "actor.rpg.stats";
type Record = StatsRecord;
}
impl<S: BosStr> LexiconSchema for Stats<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Passives<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"passives"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Personality<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"personality"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.backstory {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 5000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("backstory"),
max: 5000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.bonds {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("bonds"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.flaws {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("flaws"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.ideals {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("ideals"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.traits {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("traits"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ReverieStats<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"reverieStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.authority {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("authority"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.authority {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("authority"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.entropy {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("entropy"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.entropy {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("entropy"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.liberty {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("liberty"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.liberty {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("liberty"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.oblivion {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("oblivion"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.oblivion {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("oblivion"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.receptive {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("receptive"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.receptive {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("receptive"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.skeptic {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("skeptic"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.skeptic {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("skeptic"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RmmzStats<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"rmmzStats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.agi {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("agi"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.atk {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("atk"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.class {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("class"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.cri {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("cri"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.cri {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("cri"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.def {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("def"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.eva {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("eva"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.eva {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("eva"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.hit {
if *value > 100i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("hit"),
max: 100i64,
actual: *value,
});
}
}
if let Some(ref value) = self.hit {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("hit"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.hp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("hp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.level {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.luk {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("luk"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.mat {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("mat"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max_hp {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max_hp"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max_mp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max_mp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.max_tp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("max_tp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.mdf {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("mdf"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.mp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("mp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.tp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("tp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.xp {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("xp"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Saves<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"saves"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Skills<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"skills"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SpellList<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"spellList"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.cantrips {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("cantrips"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l1 {
#[allow(unused_comparisons)]
if value.len() > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l1"),
max: 30usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l2 {
#[allow(unused_comparisons)]
if value.len() > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l2"),
max: 30usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l3 {
#[allow(unused_comparisons)]
if value.len() > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l3"),
max: 30usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l4 {
#[allow(unused_comparisons)]
if value.len() > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l4"),
max: 30usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l5 {
#[allow(unused_comparisons)]
if value.len() > 30usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l5"),
max: 30usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l6 {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l6"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l7 {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l7"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l8 {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l8"),
max: 20usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.l9 {
#[allow(unused_comparisons)]
if value.len() > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("l9"),
max: 20usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Spellcasting<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"spellcasting"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.ability {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 3usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("ability"),
max: 3usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.dc {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("dc"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.slots {
#[allow(unused_comparisons)]
if value.len() > 9usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("slots"),
max: 9usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Spellslot<S> {
fn nsid() -> &'static str {
"actor.rpg.stats"
}
fn def_name() -> &'static str {
"spellslot"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_actor_rpg_stats()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.level;
if *value > 9i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("level"),
max: 9i64,
actual: *value,
});
}
}
{
let value = &self.level;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.total;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("total"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.used {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("used"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
fn lexicon_doc_actor_rpg_stats() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("actor.rpg.stats"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("abilities"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("The six ability scores (1-30 per SRD)"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cha"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(30i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("con"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(30i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dex"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(30i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("int"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(30i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("str"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(30i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("wis"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(30i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("attack"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("An attack action")),
required: Some(vec![SmolStr::new_static("name")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("bonus"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Attack bonus (e.g., +5)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("damage"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Damage dice (e.g., 1d8)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("damageBonus"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("damageType"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Damage type")),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Attack name")),
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("coinage"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Currency")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ep"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("gp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("combat"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Combat and defensive stats")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("ac"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hitDice"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Hit dice (e.g., 5d10)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hitDiceUsed"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("initiative"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("speed"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("conditions"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Status conditions and effects"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("deathSaves"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#deathSaves"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("exhaustion"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(6i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("inspiration"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("customStat"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("A custom stat")),
required: Some(
vec![SmolStr::new_static("name"), SmolStr::new_static("value")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("category"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Category (optional)"),
),
max_length: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("max"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("min"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Stat name")),
max_length: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("value"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("customStats"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("User-defined custom stat system"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("stats"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Custom stat entries"),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#customStat"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("systemName"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("System name")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("systemVersion"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Version")),
max_length: Some(50usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccAbilities"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"DCC ability scores (3-18 standard, can be modified by corruption/spellburn)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("agi"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("agiBase"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("int"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luk"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("per"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sta"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("staBase"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("str"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strBase"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccAttack"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A weapon attack (includes deed die for warriors)",
),
),
required: Some(vec![SmolStr::new_static("name")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("attackMod"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Attack modifier (e.g., +2, d16+2 for deed die)",
),
),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("damage"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Damage dice (e.g., 1d8+2, 1d6+d3)"),
),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("damageBonus"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Damage bonus (e.g., +2, +d3 for deed die)",
),
),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Weapon name")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("notes"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Special properties (backstab, trained weapon, etc.)",
),
),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("range"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Range (melee or distance)"),
),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Attack type (melee, ranged, etc.)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccCleric"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Cleric spellcasting features"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("deity"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Deity or supernatural patron"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("disapprovalRange"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(20i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("disapprovalTable"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Deity-specific disapproval table if any",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("holySymbol"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Holy symbol description"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("knownSpells"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Known cleric spells"),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#dccClericSpell"),
..Default::default()
}),
max_length: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("layOnHandsDie"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Lay on hands die (e.g., d14, d16)"),
),
max_length: Some(10usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("maxSpellLevel"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(5i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellCheckMod"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("turnUnholyDie"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Turn unholy die (e.g., d14, d16)"),
),
max_length: Some(10usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("unholy"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccClericSpell"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("A cleric spell")),
required: Some(
vec![SmolStr::new_static("name"), SmolStr::new_static("level")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(5i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Spell name")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("notes"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Additional spell notes"),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sinful"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccCoinage"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"DCC uses cp, sp, gp (10cp = 1sp, 10sp = 1gp)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("gp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccCombat"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Combat statistics")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("ac"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("actionDie"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Primary action die (e.g., d20, d20+d14)",
),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("attackMod"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("critDie"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Critical hit die (e.g., d8, d12, d14)"),
),
max_length: Some(10usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("critTable"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Critical hit table (I, II, III, IV, V)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("fumbleDie"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Fumble die (typically d4 for 0-level, varies by armor)",
),
),
max_length: Some(10usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("initiative"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("speed"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccCorruption"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A corruption effect from failed spell checks",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("effect"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Description of the corruption"),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("permanent"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("source"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("What spell caused this corruption"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Corruption severity (minor, major, greater)",
),
),
max_length: Some(20usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccEquipment"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Equipment and inventory")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("armor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Armor worn (affects fumble die)"),
),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("armorCheckPenalty"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("gear"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Other equipment")),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("shield"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Shield (if any)")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tradeGoods"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Trade goods from occupation"),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("treasure"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Valuables and treasure"),
),
max_length: Some(1000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("weapons"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Weapons carried")),
max_length: Some(500usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccHalfling"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Halfling class features")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("goodLuckCharm"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("infravision"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luckSpentOnAllies"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luckyWeapon"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Weapon type luck modifier applies to"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sneakAndHide"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("twoWeaponFighting"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccHp"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Hit points (0-level characters use 1d4 + STA mod)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("current"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("max"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccIdentity"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("DCC character identity and progression"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alignment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Alignment (Lawful, Neutral, Chaotic)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("class"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Class (Warrior, Wizard, Cleric, Thief, Elf, Dwarf, Halfling)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(10i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("occupation"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"0-level occupation (e.g., Blacksmith, Farmer)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Level title (e.g., Squire, Cutpurse, Acolyte)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("xp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccLuck"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Birth augur and luck mechanics"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("birthAugur"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Birth augur name (e.g., Harsh Winter, The Bull, Fortunate Date)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("birthAugurEffect"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("What the luck modifier applies to"),
),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luckyWeapon"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Weapon type that luck applies to (Dwarves/Halflings)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("startingLuck"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(24i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccSaves"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("DCC saving throws (3 saves, not 6)"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("fort"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ref"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("will"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccSpellburn"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Current spellburn (temporary ability score sacrifice)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("agiBurned"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("recoveryRate"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("staBurned"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("strBurned"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccStats"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Dungeon Crawl Classics RPG character sheet. Supports 0-level funnel characters through 10th level.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("abilities"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccAbilities"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("abilitiesNotes"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Notes about special abilities, class features, and racial traits",
),
),
max_length: Some(1000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("attacks"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("Weapon attacks")),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#dccAttack"),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cleric"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccCleric"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("coinage"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccCoinage"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("combat"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccCombat"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("equipment"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccEquipment"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("halfling"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccHalfling"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hp"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccHp"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("identity"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccIdentity"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("languages"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Languages known")),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luck"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccLuck"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("notes"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Character notes, backstory, and special abilities",
),
),
max_length: Some(5000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("saves"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccSaves"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("thief"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccThief"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("warrior"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccWarrior"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("wizard"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccWizard"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccThief"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Thief class features and skills"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alignment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Alignment (affects some skill targets)"),
),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("backstab"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luckyWeapon"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Weapon type that luck applies to (one type only)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skills"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccThiefSkills"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccThiefSkills"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Thief skill bonuses (roll d20 + skill vs target)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("backstab"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("castSpellFromScroll"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("climbSheerSurfaces"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("disableTrap"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("disguiseSelf"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("findTrap"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("forgeDocument"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handlePoison"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideInShadows"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pickLock"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pickPocket"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("readLanguages"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sneakSilently"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccWarrior"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Warrior and Dwarf class features"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("deedDie"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Current deed die (d3, d4, d5, d6, d7, d8, d10+d3, etc.)",
),
),
max_length: Some(10usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("infravision"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luckyWeapon"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Weapon type luck modifier applies to"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mightyDeeds"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Signature mighty deeds of arms"),
),
items: LexArrayItem::String(LexString {
max_length: Some(200usize),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("shieldBash"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("smellGold"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("undergroundSkills"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccWizard"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Wizard and Elf spellcasting features"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("corruption"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Corruption effects suffered (structured)",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#dccCorruption"),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("corruptionText"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Corruption effects as free-form text"),
),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("knownSpells"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Known spells with mercurial magic effects",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#dccWizardSpell"),
..Default::default()
}),
max_length: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("maxSpellLevel"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(5i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("patron"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Supernatural patron (if any)"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("patronBond"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Patron bond description and effects"),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellCheckMod"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellburn"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccSpellburn"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dccWizardSpell"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A wizard spell with mercurial magic effect"),
),
required: Some(
vec![SmolStr::new_static("name"), SmolStr::new_static("level")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(5i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lost"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mercurialMagic"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Unique mercurial magic effect (d100 roll result)",
),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mercurialRoll"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Spell name")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("notes"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Additional spell notes"),
),
max_length: Some(500usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("deathSaves"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Death saving throw successes and failures"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("failures"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(3i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("successes"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(3i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dndStats"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"D&D 5e character sheet. All sub-objects are optional.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("abilities"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#abilities"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("attacks"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("Attack actions")),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#attack"),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("coinage"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#coinage"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("combat"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#combat"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("conditions"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#conditions"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("equipment"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#equipment"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("features"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Class features, racial traits, and feats",
),
),
max_length: Some(5000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hp"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#hp"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("identity"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#identity"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("languages"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Languages known")),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("passives"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#passives"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("personality"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#personality"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("proficiencies"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Armor, weapon, and tool proficiencies"),
),
max_length: Some(1000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("saves"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#saves"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skills"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#skills"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellcasting"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#spellcasting"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("equipment"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Gear and inventory")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("armor"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Armor")),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("gear"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Other equipment")),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("treasure"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Valuables and treasure"),
),
max_length: Some(1000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("weapons"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Weapons")),
max_length: Some(500usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hp"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Hit point tracking")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("current"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("max"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("temp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("identity"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Character identity and progression"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alignment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Alignment (e.g., Lawful Good)"),
),
max_length: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("background"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Background (e.g., Soldier, Sage)"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("class"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Class and subclass (e.g., Fighter (Champion))",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("proficiency"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("race"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Race (e.g., Human, Elf, Dwarf)"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("xp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"A user's RPG character statistics. One record per user (rkey: self).",
),
),
key: Some(CowStr::new_static("literal:self")),
record: LexRecordRecord::Object(LexObject {
required: Some(vec![SmolStr::new_static("createdAt")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Timestamp when this record was created"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("custom"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#customStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dcc"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dccStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dnd"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#dndStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reverie"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#reverieStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rmmz"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#rmmzStats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Timestamp when this record was last modified",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("passives"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Passive scores (10 + skill modifier)"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("insight"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("investigation"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("perception"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("personality"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Personality and backstory")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("backstory"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Backstory")),
max_length: Some(5000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("bonds"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Bonds")),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("flaws"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Flaws")),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ideals"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Ideals")),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("traits"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Personality traits")),
max_length: Some(1000usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reverieStats"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Reverie House philosophical alignment"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("authority"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("entropy"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("liberty"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("oblivion"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("octant"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Philosophical octant"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("receptive"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skeptic"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rmmzStats"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("RPG Maker MZ character parameters"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("agi"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("atk"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("class"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Class")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cri"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("def"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("eva"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hit"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(100i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("luk"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mat"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("maxHp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("maxMp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("maxTp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mdf"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("xp"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("saves"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Saving throw modifiers (actual values, not proficiency flags)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cha"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("con"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dex"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("int"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("str"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("wis"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skills"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Skill modifiers (actual values, not proficiency flags)",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("acrobatics"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("animalHandling"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("arcana"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("athletics"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("deception"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("history"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("insight"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("intimidation"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("investigation"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("medicine"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("nature"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("perception"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("performance"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("persuasion"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("religion"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sleightOfHand"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("stealth"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("survival"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellList"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Spells organized by level")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cantrips"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("Cantrips (at-will)")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l1"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("1st-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l2"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("2nd-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l3"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("3rd-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l4"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("4th-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l5"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("5th-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(30usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l6"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("6th-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l7"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("7th-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l8"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("8th-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("l9"),
LexObjectProperty::Array(LexArray {
description: Some(CowStr::new_static("9th-level spells")),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(20usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellcasting"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Spellcasting details")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("ability"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Spellcasting ability (INT, WIS, CHA)"),
),
max_length: Some(3usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("attack"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("dc"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("slots"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Spell slots by level"),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#spellslot"),
..Default::default()
}),
max_length: Some(9usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spells"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#spellList"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("spellslot"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Spell slot entry")),
required: Some(
vec![SmolStr::new_static("level"), SmolStr::new_static("total")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
maximum: Some(9i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("total"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("used"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod custom_stat_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Name;
type Value;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type Value = Unset;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Name = Set<members::name>;
type Value = St::Value;
}
pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetValue<St> {}
impl<St: State> State for SetValue<St> {
type Name = St::Name;
type Value = Set<members::value>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct value(());
}
}
pub struct CustomStatBuilder<S: BosStr, St: custom_stat_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<i64>, Option<i64>, Option<S>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> CustomStat<S> {
pub fn new() -> CustomStatBuilder<S, custom_stat_state::Empty> {
CustomStatBuilder::new()
}
}
impl<S: BosStr> CustomStatBuilder<S, custom_stat_state::Empty> {
pub fn new() -> Self {
CustomStatBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: custom_stat_state::State> CustomStatBuilder<S, St> {
pub fn category(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_category(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: custom_stat_state::State> CustomStatBuilder<S, St> {
pub fn max(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_max(mut self, value: Option<i64>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: custom_stat_state::State> CustomStatBuilder<S, St> {
pub fn min(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_min(mut self, value: Option<i64>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> CustomStatBuilder<S, St>
where
St: custom_stat_state::State,
St::Name: custom_stat_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> CustomStatBuilder<S, custom_stat_state::SetName<St>> {
self._fields.3 = Option::Some(value.into());
CustomStatBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CustomStatBuilder<S, St>
where
St: custom_stat_state::State,
St::Value: custom_stat_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<i64>,
) -> CustomStatBuilder<S, custom_stat_state::SetValue<St>> {
self._fields.4 = Option::Some(value.into());
CustomStatBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CustomStatBuilder<S, St>
where
St: custom_stat_state::State,
St::Name: custom_stat_state::IsSet,
St::Value: custom_stat_state::IsSet,
{
pub fn build(self) -> CustomStat<S> {
CustomStat {
category: self._fields.0,
max: self._fields.1,
min: self._fields.2,
name: self._fields.3.unwrap(),
value: self._fields.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> CustomStat<S> {
CustomStat {
category: self._fields.0,
max: self._fields.1,
min: self._fields.2,
name: self._fields.3.unwrap(),
value: self._fields.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod dcc_cleric_spell_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Name;
type Level;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Name = Unset;
type Level = Unset;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Name = Set<members::name>;
type Level = St::Level;
}
pub struct SetLevel<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLevel<St> {}
impl<St: State> State for SetLevel<St> {
type Name = St::Name;
type Level = Set<members::level>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct name(());
pub struct level(());
}
}
pub struct DccClericSpellBuilder<S: BosStr, St: dcc_cleric_spell_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<S>, Option<S>, Option<bool>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> DccClericSpell<S> {
pub fn new() -> DccClericSpellBuilder<S, dcc_cleric_spell_state::Empty> {
DccClericSpellBuilder::new()
}
}
impl<S: BosStr> DccClericSpellBuilder<S, dcc_cleric_spell_state::Empty> {
pub fn new() -> Self {
DccClericSpellBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> DccClericSpellBuilder<S, St>
where
St: dcc_cleric_spell_state::State,
St::Level: dcc_cleric_spell_state::IsUnset,
{
pub fn level(
mut self,
value: impl Into<i64>,
) -> DccClericSpellBuilder<S, dcc_cleric_spell_state::SetLevel<St>> {
self._fields.0 = Option::Some(value.into());
DccClericSpellBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> DccClericSpellBuilder<S, St>
where
St: dcc_cleric_spell_state::State,
St::Name: dcc_cleric_spell_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> DccClericSpellBuilder<S, dcc_cleric_spell_state::SetName<St>> {
self._fields.1 = Option::Some(value.into());
DccClericSpellBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: dcc_cleric_spell_state::State> DccClericSpellBuilder<S, St> {
pub fn notes(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_notes(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: dcc_cleric_spell_state::State> DccClericSpellBuilder<S, St> {
pub fn sinful(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_sinful(mut self, value: Option<bool>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> DccClericSpellBuilder<S, St>
where
St: dcc_cleric_spell_state::State,
St::Name: dcc_cleric_spell_state::IsSet,
St::Level: dcc_cleric_spell_state::IsSet,
{
pub fn build(self) -> DccClericSpell<S> {
DccClericSpell {
level: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
notes: self._fields.2,
sinful: self._fields.3,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> DccClericSpell<S> {
DccClericSpell {
level: self._fields.0.unwrap(),
name: self._fields.1.unwrap(),
notes: self._fields.2,
sinful: self._fields.3,
extra_data: Some(extra_data),
}
}
}
pub mod dcc_wizard_spell_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Level;
type Name;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Level = Unset;
type Name = Unset;
}
pub struct SetLevel<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLevel<St> {}
impl<St: State> State for SetLevel<St> {
type Level = Set<members::level>;
type Name = St::Name;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type Level = St::Level;
type Name = Set<members::name>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct level(());
pub struct name(());
}
}
pub struct DccWizardSpellBuilder<S: BosStr, St: dcc_wizard_spell_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<bool>, Option<S>, Option<i64>, Option<S>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> DccWizardSpell<S> {
pub fn new() -> DccWizardSpellBuilder<S, dcc_wizard_spell_state::Empty> {
DccWizardSpellBuilder::new()
}
}
impl<S: BosStr> DccWizardSpellBuilder<S, dcc_wizard_spell_state::Empty> {
pub fn new() -> Self {
DccWizardSpellBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> DccWizardSpellBuilder<S, St>
where
St: dcc_wizard_spell_state::State,
St::Level: dcc_wizard_spell_state::IsUnset,
{
pub fn level(
mut self,
value: impl Into<i64>,
) -> DccWizardSpellBuilder<S, dcc_wizard_spell_state::SetLevel<St>> {
self._fields.0 = Option::Some(value.into());
DccWizardSpellBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: dcc_wizard_spell_state::State> DccWizardSpellBuilder<S, St> {
pub fn lost(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_lost(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: dcc_wizard_spell_state::State> DccWizardSpellBuilder<S, St> {
pub fn mercurial_magic(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_mercurial_magic(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: dcc_wizard_spell_state::State> DccWizardSpellBuilder<S, St> {
pub fn mercurial_roll(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_mercurial_roll(mut self, value: Option<i64>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> DccWizardSpellBuilder<S, St>
where
St: dcc_wizard_spell_state::State,
St::Name: dcc_wizard_spell_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> DccWizardSpellBuilder<S, dcc_wizard_spell_state::SetName<St>> {
self._fields.4 = Option::Some(value.into());
DccWizardSpellBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: dcc_wizard_spell_state::State> DccWizardSpellBuilder<S, St> {
pub fn notes(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_notes(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> DccWizardSpellBuilder<S, St>
where
St: dcc_wizard_spell_state::State,
St::Level: dcc_wizard_spell_state::IsSet,
St::Name: dcc_wizard_spell_state::IsSet,
{
pub fn build(self) -> DccWizardSpell<S> {
DccWizardSpell {
level: self._fields.0.unwrap(),
lost: self._fields.1,
mercurial_magic: self._fields.2,
mercurial_roll: self._fields.3,
name: self._fields.4.unwrap(),
notes: self._fields.5,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> DccWizardSpell<S> {
DccWizardSpell {
level: self._fields.0.unwrap(),
lost: self._fields.1,
mercurial_magic: self._fields.2,
mercurial_roll: self._fields.3,
name: self._fields.4.unwrap(),
notes: self._fields.5,
extra_data: Some(extra_data),
}
}
}
pub mod stats_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
}
}
pub struct StatsBuilder<S: BosStr, St: stats_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<stats::CustomStats<S>>,
Option<stats::DccStats<S>>,
Option<stats::DndStats<S>>,
Option<stats::ReverieStats<S>>,
Option<stats::RmmzStats<S>>,
Option<Datetime>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Stats<S> {
pub fn new() -> StatsBuilder<S, stats_state::Empty> {
StatsBuilder::new()
}
}
impl<S: BosStr> StatsBuilder<S, stats_state::Empty> {
pub fn new() -> Self {
StatsBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StatsBuilder<S, St>
where
St: stats_state::State,
St::CreatedAt: stats_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> StatsBuilder<S, stats_state::SetCreatedAt<St>> {
self._fields.0 = Option::Some(value.into());
StatsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: stats_state::State> StatsBuilder<S, St> {
pub fn custom(mut self, value: impl Into<Option<stats::CustomStats<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_custom(mut self, value: Option<stats::CustomStats<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: stats_state::State> StatsBuilder<S, St> {
pub fn dcc(mut self, value: impl Into<Option<stats::DccStats<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_dcc(mut self, value: Option<stats::DccStats<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: stats_state::State> StatsBuilder<S, St> {
pub fn dnd(mut self, value: impl Into<Option<stats::DndStats<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_dnd(mut self, value: Option<stats::DndStats<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: stats_state::State> StatsBuilder<S, St> {
pub fn reverie(mut self, value: impl Into<Option<stats::ReverieStats<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_reverie(mut self, value: Option<stats::ReverieStats<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: stats_state::State> StatsBuilder<S, St> {
pub fn rmmz(mut self, value: impl Into<Option<stats::RmmzStats<S>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_rmmz(mut self, value: Option<stats::RmmzStats<S>>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: stats_state::State> StatsBuilder<S, St> {
pub fn updated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_updated_at(mut self, value: Option<Datetime>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> StatsBuilder<S, St>
where
St: stats_state::State,
St::CreatedAt: stats_state::IsSet,
{
pub fn build(self) -> Stats<S> {
Stats {
created_at: self._fields.0.unwrap(),
custom: self._fields.1,
dcc: self._fields.2,
dnd: self._fields.3,
reverie: self._fields.4,
rmmz: self._fields.5,
updated_at: self._fields.6,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Stats<S> {
Stats {
created_at: self._fields.0.unwrap(),
custom: self._fields.1,
dcc: self._fields.2,
dnd: self._fields.3,
reverie: self._fields.4,
rmmz: self._fields.5,
updated_at: self._fields.6,
extra_data: Some(extra_data),
}
}
}
pub mod spellslot_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Total;
type Level;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Total = Unset;
type Level = Unset;
}
pub struct SetTotal<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTotal<St> {}
impl<St: State> State for SetTotal<St> {
type Total = Set<members::total>;
type Level = St::Level;
}
pub struct SetLevel<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLevel<St> {}
impl<St: State> State for SetLevel<St> {
type Total = St::Total;
type Level = Set<members::level>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct total(());
pub struct level(());
}
}
pub struct SpellslotBuilder<S: BosStr, St: spellslot_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Spellslot<S> {
pub fn new() -> SpellslotBuilder<S, spellslot_state::Empty> {
SpellslotBuilder::new()
}
}
impl<S: BosStr> SpellslotBuilder<S, spellslot_state::Empty> {
pub fn new() -> Self {
SpellslotBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SpellslotBuilder<S, St>
where
St: spellslot_state::State,
St::Level: spellslot_state::IsUnset,
{
pub fn level(
mut self,
value: impl Into<i64>,
) -> SpellslotBuilder<S, spellslot_state::SetLevel<St>> {
self._fields.0 = Option::Some(value.into());
SpellslotBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SpellslotBuilder<S, St>
where
St: spellslot_state::State,
St::Total: spellslot_state::IsUnset,
{
pub fn total(
mut self,
value: impl Into<i64>,
) -> SpellslotBuilder<S, spellslot_state::SetTotal<St>> {
self._fields.1 = Option::Some(value.into());
SpellslotBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: spellslot_state::State> SpellslotBuilder<S, St> {
pub fn used(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_used(mut self, value: Option<i64>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> SpellslotBuilder<S, St>
where
St: spellslot_state::State,
St::Total: spellslot_state::IsSet,
St::Level: spellslot_state::IsSet,
{
pub fn build(self) -> Spellslot<S> {
Spellslot {
level: self._fields.0.unwrap(),
total: self._fields.1.unwrap(),
used: self._fields.2,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> Spellslot<S> {
Spellslot {
level: self._fields.0.unwrap(),
total: self._fields.1.unwrap(),
used: self._fields.2,
extra_data: Some(extra_data),
}
}
}