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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use crate::types::vector::Vector3;

pub mod events;
pub mod functions;

pub use functions::load_functions;

/// Types Of Race Checkpoints
#[repr(C)]
#[derive(PartialEq, Clone, Copy, Debug)]
pub enum RaceCheckpointType {
    /// Normal, must have nextPosition, else it shows as RACE_FINISH
    Normal = 0,
    /// Finish checkpoint, must have no nextPosition, else it shows as RACE_NORMAL
    Finish,
    /// Nothing (Only the checkpoint without anything on it)     
    Nothing,
    /// Normal Air Checkpoint
    AirNormal,
    /// Air Finish Checkpoint
    AirFinish,
    /// Air (rotates and stops)
    AirOne,
    /// Air (increases, decreases and disappears)
    AirTwo,
    /// Air (swings down and up)
    AirThree,
    /// Air (swings up and down)
    AirFour,
    /// None
    None,
}

/// Player race checkpoint information
pub struct PlayerRaceCheckPointData {
    /// position of checkpoint
    pub center_pos: Vector3,
    /// coordinates of next checkpoint, also used for arrow direction
    pub next_pos: Vector3,
    /// radius of the checkpoint
    pub radius: f32,
}

impl PlayerRaceCheckPointData {
    pub fn new(center_pos: Vector3, next_pos: Vector3, radius: f32) -> Self {
        Self {
            center_pos,
            next_pos,
            radius,
        }
    }
}

/// Player checkpoint information
#[derive(PartialEq, Clone, Copy, Debug)]
pub struct PlayerCheckPointData {
    /// position of checkpoint
    pub center_pos: Vector3,
    /// radius of the checkpoint
    pub radius: f32,
}

impl PlayerCheckPointData {
    pub fn new(center_pos: Vector3, radius: f32) -> Self {
        Self { center_pos, radius }
    }
}