aboutsummaryrefslogtreecommitdiff
path: root/src/event.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-09-28 13:57:37 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-09-28 13:57:37 +0200
commit9f73455cc21f5991dcb2844c369bb4ca7df64747 (patch)
tree4041707fe6fdcc6899e228e0c54b1dff3bfa53d9 /src/event.rs
parent52deb7c4a8ed0a3714abe10c6d532e34f784f86c (diff)
downloadevtclib-9f73455cc21f5991dcb2844c369bb4ca7df64747.tar.gz
evtclib-9f73455cc21f5991dcb2844c369bb4ca7df64747.tar.bz2
evtclib-9f73455cc21f5991dcb2844c369bb4ca7df64747.zip
optionally implement serde::{Des,S}erialize
Diffstat (limited to 'src/event.rs')
-rw-r--r--src/event.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/event.rs b/src/event.rs
index f9ee8e5..f90ed3a 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -26,6 +26,7 @@ pub enum FromRawEventError {
/// A rusty enum for all possible combat events.
///
/// This makes dealing with [`CbtEvent`][raw::CbtEvent] a bit saner (and safer).
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, PartialEq)]
pub enum EventKind {
// State change events
@@ -213,6 +214,7 @@ pub enum EventKind {
///
/// Note that if you plan on re-using the raw event afterwards, you should use the implementation
/// that works on a reference instead: `Event::try_from(&raw_event)`.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, PartialEq, CopyGetters, Getters)]
pub struct Event {
/// The time when the event happened.
@@ -524,6 +526,7 @@ fn get_error_bytes(raw_event: &raw::CbtEvent) -> [u8; 32] {
}
/// The different weapon-sets in game.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum WeaponSet {
/// First water weapon set.
@@ -558,6 +561,7 @@ impl WeaponSet {
/// The different types to activate a skill.
///
/// The parameter is the animation time in milliseconds.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Activation {
/// The skill was activated with quickness.