aboutsummaryrefslogtreecommitdiff
path: root/stockton-levels/src/types.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:23 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:23 +0100
commit439219e74090c7158f8dbc33fed4107a5eb7c003 (patch)
tree7ba62254b2d888578ff6c1c8de4f0f35c01c75dd /stockton-levels/src/types.rs
parent04f17923d38171f07f72603a54237f20ca3572dd (diff)
refactor(levels): no longer q3 specific
Diffstat (limited to 'stockton-levels/src/types.rs')
-rw-r--r--stockton-levels/src/types.rs19
1 files changed, 3 insertions, 16 deletions
diff --git a/stockton-levels/src/types.rs b/stockton-levels/src/types.rs
index dd42a5e..dad824c 100644
--- a/stockton-levels/src/types.rs
+++ b/stockton-levels/src/types.rs
@@ -1,10 +1,10 @@
//! Various types used in parsed BSP files.
+use serde::{Deserialize, Serialize};
use std::convert::TryInto;
-use thiserror::Error;
/// RGBA Colour (0-255)
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct Rgba {
pub r: u8,
pub g: u8,
@@ -32,7 +32,7 @@ impl Rgba {
}
/// RGB Colour (0-255)
-#[derive(Debug, Clone, Copy, PartialEq)]
+#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct Rgb {
pub r: u8,
pub g: u8,
@@ -65,16 +65,3 @@ impl Rgb {
Rgb::from_bytes(slice.try_into().unwrap())
}
}
-
-#[derive(Error, Debug)]
-/// An error encountered while parsing.
-pub enum ParseError {
- #[error("Unsupported format")]
- Unsupported,
-
- #[error("Invalid file")]
- Invalid,
-}
-
-/// Standard result type.
-pub type Result<T> = std::result::Result<T, ParseError>;