added documentation

This commit is contained in:
MaxOhn
2021-01-17 22:11:27 +01:00
parent bbc6698fc7
commit 5e01f867ce
22 changed files with 350 additions and 96 deletions
+4
View File
@@ -1,5 +1,6 @@
use crate::Mods;
/// Summary struct for a [`Beatmap`](crate::Beatmap)'s attributes.
#[derive(Clone, Debug)]
pub struct BeatmapAttributes {
pub ar: f32,
@@ -27,6 +28,9 @@ impl BeatmapAttributes {
}
}
/// Adjusts attributes w.r.t. mods.
/// AR is further adjusted by the its hitwindow.
/// OD is __not__ adjusted by its hitwindow.
pub fn mods(self, mods: impl Mods) -> Self {
if !mods.change_map() {
return self;
+2
View File
@@ -1,5 +1,6 @@
use std::cmp::Ordering;
/// New rhythm speed change.
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct TimingPoint {
pub beat_len: f32,
@@ -13,6 +14,7 @@ impl PartialOrd for TimingPoint {
}
}
/// [`TimingPoint`](crate::parse::TimingPoint) that depends on a previous one.
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct DifficultyPoint {
pub time: f32,
+3
View File
@@ -2,6 +2,8 @@ use super::{PathType, Pos2};
use std::cmp::Ordering;
/// "Intermediate" hitobject created through parsing.
/// Each mode will handle them differently.
#[derive(Clone, Debug, PartialEq)]
pub struct HitObject {
pub pos: Pos2,
@@ -43,6 +45,7 @@ impl PartialOrd for HitObject {
}
}
/// Further data related to specific object types.
#[derive(Clone, Debug, PartialEq)]
pub enum HitObjectKind {
Circle,
+1
View File
@@ -1,6 +1,7 @@
use std::fmt;
use std::ops;
/// Simple (x, y) coordinate
#[derive(Clone, Copy, Default, PartialEq)]
pub struct Pos2 {
pub x: f32,