summaryrefslogtreecommitdiff
path: root/src/property.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-07-07 11:45:49 -0500
committertom barrett <spalf0@gmail.com>2019-07-07 11:45:49 -0500
commitde4e8c1f0b82627fd1980401ae63472f49c9d89c (patch)
treebcbffde08ac2e5bf843abee0dc61c2d7e20fd03b /src/property.rs
parentbfdaef7850b6ac17bb88f1b314236fb5014aac8e (diff)
reorganized
Diffstat (limited to 'src/property.rs')
-rw-r--r--src/property.rs57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/property.rs b/src/property.rs
deleted file mode 100644
index b57d54c..0000000
--- a/src/property.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-use xml::reader::XmlEvent;
-
-use crate::xmlelements::XMLElements;
-
-#[derive(Debug, Clone, PartialEq)]
-pub struct Property {
- pub entity: Option<String>,
- pub rotation: f32,
- pub keyframe: Option<usize>,
- pub delay: Option<usize>,
- pub spawn: Option<String>,
- pub visible: Option<bool>,
-}
-
-impl Property {
- pub fn new(property_elements: Vec<XmlEvent>) -> Property {
- let entity = match XMLElements::get_attribute_value(&property_elements, "entity") {
- Ok(entity) => entity.parse().ok(),
- Err(_) => None,
- };
- let keyframe = match XMLElements::get_attribute_value(&property_elements, "keyframe") {
- Ok(keyframe) => keyframe.parse().ok(),
- Err(_) => None,
- };
- let delay = match XMLElements::get_attribute_value(&property_elements, "delay") {
- Ok(delay) => delay.parse().ok(),
- Err(_) => None,
- };
- let spawn = XMLElements::get_attribute_value(&property_elements, "spawn").ok();
- let visible = match XMLElements::get_attribute_value(&property_elements, "visible") {
- Ok(visible) => visible.parse().ok(),
- Err(_) => None,
- };
-
- Property {
- rotation: 0.0,
- entity,
- keyframe,
- delay,
- spawn,
- visible,
- }
- }
-}
-
-impl Default for Property {
- fn default() -> Property {
- Property {
- rotation: 0.0,
- entity: None,
- keyframe: None,
- delay: None,
- spawn: None,
- visible: None,
- }
- }
-}