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
use std::ops::{Deref, DerefMut};

use super::AmbientCreature;

/// An instance of a bat
#[derive(PartialEq)]
pub struct Bat {
    ambient_crature: AmbientCreature,
    /// Whether it is hanging or not
    pub is_hanging: bool,
}
impl Deref for Bat {
    type Target = AmbientCreature;

    fn deref(&self) -> &Self::Target {
        &self.ambient_crature
    }
}
impl DerefMut for Bat {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.ambient_crature
    }
}
impl Default for Bat {
    fn default() -> Self {
        Self {
            ambient_crature: AmbientCreature::default(),
            is_hanging: false,
        }
    }
}