use crate::{
lex::command::{Key, NoteKind, ObjId},
time::ObjTime,
};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Obj {
pub offset: ObjTime,
pub kind: NoteKind,
pub is_player1: bool,
pub key: Key,
pub obj: ObjId,
}
impl PartialOrd for Obj {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
impl Ord for Obj {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.offset
.cmp(&other.offset)
.then(self.obj.cmp(&other.obj))
}
}