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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
use std::cmp::Ordering;
use crate::hitsounds::{Additions, SampleInfo, SampleSet};
use crate::{Point, TimeLocation, TimingPoint};
#[derive(Clone, Debug)]
pub enum SliderSplineKind {
Linear,
Bezier,
Catmull,
Perfect,
}
#[derive(Clone, Debug)]
pub enum HitObjectKind {
Circle,
Slider {
kind: SliderSplineKind,
control: Vec<Point<i32>>,
num_repeats: u32,
pixel_length: f64,
edge_additions: Vec<Additions>,
edge_samplesets: Vec<(SampleSet, SampleSet)>,
},
Spinner {
end_time: TimeLocation,
},
}
#[derive(Clone, Debug)]
pub struct HitObject {
pub pos: Point<i32>,
pub start_time: TimeLocation,
pub kind: HitObjectKind,
pub new_combo: bool,
pub timing_point: Option<TimingPoint>,
pub skip_color: i32,
pub additions: Additions,
pub sample_info: SampleInfo,
}
impl Ord for HitObject {
fn cmp(&self, other: &Self) -> Ordering {
self.start_time.cmp(&other.start_time)
}
}
impl PartialOrd for HitObject {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Eq for HitObject {}
impl PartialEq for HitObject {
fn eq(&self, other: &Self) -> bool {
self.start_time == other.start_time
}
}