livesplit_core/timing/timing_method.rs
1use serde::{Deserialize, Serialize};
2
3/// A `TimingMethod` describes which form of timing is used. This can either be
4/// [`TimingMethod::RealTime`] or [`TimingMethod::GameTime`].
5#[derive(Copy, Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
6#[repr(u8)]
7pub enum TimingMethod {
8 /// `Real Time` is the unmodified timing that is as close to an atomic clock
9 /// as possible.
10 RealTime = 0,
11 /// `Game Time` describes the timing that is provided by the game that is
12 /// being run. This is entirely optional and may either be `Real Time` with
13 /// loading times removed or some time provided by the game.
14 GameTime = 1,
15}
16
17impl TimingMethod {
18 /// Returns an array of all the timing methods.
19 pub const fn all() -> [TimingMethod; 2] {
20 [TimingMethod::RealTime, TimingMethod::GameTime]
21 }
22}