Struct etterna::SkillTimeline [−][src]
Representation of a player’s ratings over time. See skill_timeline
Fields
changes: Vec<(T, Skillsets8)>
Implementations
impl<T: PartialEq + Send> SkillTimeline<T>
[src]
pub fn calculate<I>(iterator: I, pre_070: bool) -> SkillTimeline<T> where
I: IntoIterator<Item = (T, Skillsets7)>,
[src]
I: IntoIterator<Item = (T, Skillsets7)>,
Generate a timeline of player ratings over time. The input is given in form of an iterator over tuples of each score’s group identifier and the score’s skillsets.
“What’s a group identifier” you might ask. Well, this function doesn’t re-calculate the player’s rating for each and every score. That would be wasteful. Instead, scores are grouped, usually by day, and the rating is re-calculated for each group.
You can use almost any type you want as a group identifier as long as it can be compared (has a PartialEq impl).
You can either use the current, 0.70+ algorithm, or the old algorithm from older game versions.
For that, use the pre_070
parameter.
scores = &[ ("2020-08-05", ChartSkillsets { ... }), ("2020-08-05", ChartSkillsets { ... }), ("2020-08-05", ChartSkillsets { ... }), ("2020-08-06", ChartSkillsets { ... }), ("2020-08-06", ChartSkillsets { ... }), ]; let timeline = skill_timeline(scores, false); assert_eq!(timeline.changes.len(), 2);
Trait Implementations
impl<T: Clone> Clone for SkillTimeline<T>
[src]
fn clone(&self) -> SkillTimeline<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for SkillTimeline<T>
[src]
impl<T: Default> Default for SkillTimeline<T>
[src]
fn default() -> SkillTimeline<T>
[src]
impl<T: PartialEq> PartialEq<SkillTimeline<T>> for SkillTimeline<T>
[src]
fn eq(&self, other: &SkillTimeline<T>) -> bool
[src]
fn ne(&self, other: &SkillTimeline<T>) -> bool
[src]
impl<T> StructuralPartialEq for SkillTimeline<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for SkillTimeline<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for SkillTimeline<T> where
T: Send,
T: Send,
impl<T> Sync for SkillTimeline<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SkillTimeline<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SkillTimeline<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,