1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use std::ops::{Deref, DerefMut};

use super::Entity;

mod boat;
pub use boat::*;
mod abstract_minecart;
pub use abstract_minecart::*;

/// An Interface to store vehicle data
#[derive(PartialEq)]
pub struct AbstractVehicle {
    entity: Entity,
    /// The amount of shaking of the vehicle
    pub shaking_power: i32,
    /// The direction of the shaking
    pub shaking_direction: i32,
    /// The multiplier of the shaking
    pub shaking_multiplier: f32,
}
impl Default for AbstractVehicle {
    fn default() -> Self {
        Self {
            entity: Entity::default(),
            shaking_power: 0,
            shaking_direction: 1,
            shaking_multiplier: 0.0,
        }
    }
}
impl Deref for AbstractVehicle {
    type Target = Entity;

    fn deref(&self) -> &Self::Target {
        &self.entity
    }
}
impl DerefMut for AbstractVehicle {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.entity
    }
}