aboutsummaryrefslogtreecommitdiff
path: root/src/raw
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/raw
parent52deb7c4a8ed0a3714abe10c6d532e34f784f86c (diff)
downloadevtclib-9f73455cc21f5991dcb2844c369bb4ca7df64747.tar.gz
evtclib-9f73455cc21f5991dcb2844c369bb4ca7df64747.tar.bz2
evtclib-9f73455cc21f5991dcb2844c369bb4ca7df64747.zip
optionally implement serde::{Des,S}erialize
Diffstat (limited to 'src/raw')
-rw-r--r--src/raw/types.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/raw/types.rs b/src/raw/types.rs
index fe4a907..0f840bd 100644
--- a/src/raw/types.rs
+++ b/src/raw/types.rs
@@ -7,6 +7,7 @@ use std::{self, fmt};
use std::hash::{Hash, Hasher};
/// The "friend or foe" enum.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum IFF {
/// Green vs green, red vs red.
@@ -26,6 +27,7 @@ impl Default for IFF {
}
/// Combat result (physical)
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum CbtResult {
/// Good physical hit
@@ -59,6 +61,7 @@ impl Default for CbtResult {
}
/// Combat activation
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum CbtActivation {
/// Field is not used in this kind of event.
@@ -85,6 +88,7 @@ impl Default for CbtActivation {
///
/// The referenced fields are of the [`CbtEvent`](struct.CbtEvent.html)
/// struct.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum CbtStateChange {
/// Field is not used in this kind of event.
@@ -212,6 +216,7 @@ impl Default for CbtStateChange {
}
/// Combat buff remove type
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum CbtBuffRemove {
/// Field is not used in this kind of event.
@@ -235,6 +240,7 @@ impl Default for CbtBuffRemove {
}
/// Custom skill ids
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum CbtCustomSkill {
/// Not custom but important and unnamed.
@@ -246,6 +252,7 @@ pub enum CbtCustomSkill {
}
/// Language
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum Language {
/// English.
@@ -270,6 +277,7 @@ impl Default for Language {
/// arcdps.
///
/// The suffix `Inc` indicates an increase, whereas the suffix `Rec` stands for received.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum Attribute {
None,
@@ -294,6 +302,7 @@ pub enum Attribute {
}
/// Categories for [`BuffInfo`][CbtStateChange::BuffInfo] events.
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, FromPrimitive)]
pub enum BuffCategory {
Boon = 0,
@@ -314,6 +323,7 @@ pub enum BuffCategory {
/// to check the header.revision tag.
///
/// For conflicting data types, the bigger one is chosen (e.g. u32 over u16).
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
pub struct CbtEvent {
/// System time since Windows was started, in milliseconds.