Struct etterna::SkillTimeline[][src]

pub struct SkillTimeline<T> {
    pub changes: Vec<(T, Skillsets8)>,
}

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]

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]

impl<T: Debug> Debug for SkillTimeline<T>[src]

impl<T: Default> Default for SkillTimeline<T>[src]

impl<T: PartialEq> PartialEq<SkillTimeline<T>> for SkillTimeline<T>[src]

impl<T> StructuralPartialEq for SkillTimeline<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for SkillTimeline<T> where
    T: RefUnwindSafe

impl<T> Send for SkillTimeline<T> where
    T: Send

impl<T> Sync for SkillTimeline<T> where
    T: Sync

impl<T> Unpin for SkillTimeline<T> where
    T: Unpin

impl<T> UnwindSafe for SkillTimeline<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.