diff --git a/core/src/event.rs b/core/src/event.rs index ded74b5..e8a4b51 100644 --- a/core/src/event.rs +++ b/core/src/event.rs @@ -48,7 +48,7 @@ impl Event { /// # EventSpec /// /// A specification of an event -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "openapi", derive(JsonSchema))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct EventSpec { @@ -63,7 +63,7 @@ macro_rules! events { /// # EventTypeSpec /// /// A specification of an event type - #[derive(Clone, Debug)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "openapi", derive(JsonSchema))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum EventTypeSpec { @@ -146,7 +146,7 @@ pub trait EventTrait { } } -mod test { +pub mod test { use super::*; #[derive(Clone, Debug)] @@ -156,7 +156,7 @@ mod test { pub num_players: i64, } - #[derive(Clone, Debug)] + #[derive(Clone, Debug, Default, PartialEq)] #[cfg_attr(feature = "openapi", derive(JsonSchema))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TestSpec { @@ -195,7 +195,7 @@ mod test { } } -mod team_game { +pub mod team_game { use super::{ free_for_all_game::{ FreeForAllGame, FreeForAllGameSpec, FreeForAllGameUpdate, @@ -216,7 +216,7 @@ mod team_game { pub ffa_game: FreeForAllGame, } - #[derive(Clone, Debug)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "openapi", derive(JsonSchema))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct TeamGameSpec { @@ -339,7 +339,7 @@ mod team_game { } } -mod free_for_all_game { +pub mod free_for_all_game { use std::collections::HashSet; use super::*; @@ -385,7 +385,7 @@ mod free_for_all_game { vec![-3, -2, -1] } - #[derive(Clone, Debug)] + #[derive(Clone, Debug, PartialEq)] #[cfg_attr(feature = "openapi", derive(JsonSchema))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct FreeForAllGameSpec { @@ -554,3 +554,9 @@ mod free_for_all_game { } events!(test => Test, team_game => TeamGame, free_for_all_game => FreeForAllGame); + +impl Default for EventTypeSpec { + fn default() -> Self { + Self::Test(test::TestSpec::default()) + } +} diff --git a/web/dist/index.html b/web/dist/index.html index 824f509..722323c 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -4,9 +4,9 @@