TemplateID::new now returns Result<T, TemplateNotFoundError> Cleanup code in some of new handlers
25 lines
550 B
Rust
25 lines
550 B
Rust
use std::u32;
|
|
|
|
use serde::Deserialize;
|
|
|
|
template_id!(VariableData id);
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
#[serde(rename_all = "PascalCase")]
|
|
pub struct VariableDataTemplate {
|
|
#[serde(rename = "ID")]
|
|
pub id: VariableDataID,
|
|
#[serde(rename = "BattleEventID")]
|
|
pub battle_event_id: u32,
|
|
pub variable_name: String,
|
|
pub value_type: VariableValueType,
|
|
pub initial_value: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
|
|
#[serde(rename_all = "snake_case")]
|
|
pub enum VariableValueType {
|
|
Int,
|
|
Bool,
|
|
Float,
|
|
}
|