pub struct LockoutTracker { /* private fields */ }Expand description
Tracks tech/vcancel lockout behavior.
ⓘ
let mut tracker = LockoutTracker::default();
for i in 1..frames.len() {
tracker.update(frames.pre.engine_buttons[i], frames.post.flags.as_ref().unwrap()[i]);
if tracker.is_locked_out() {
...
}
...
}Implementations§
Source§impl LockoutTracker
impl LockoutTracker
Sourcepub fn update(&mut self, engine_inputs: u32, flags: u64)
pub fn update(&mut self, engine_inputs: u32, flags: u64)
Updates the state of the tracker with new frame information. Requires frame data to be passed in order
Sourcepub fn is_locked_out(&self) -> bool
pub fn is_locked_out(&self) -> bool
Returns true if the player is currently locked out of teching
Sourcepub fn can_vcancel(&self) -> bool
pub fn can_vcancel(&self) -> bool
Returns true if the 2 frame vcancel window is active
Sourcepub fn input_during_hitlag(&self) -> bool
pub fn input_during_hitlag(&self) -> bool
Returns true if the input occurred during hitlag. For any hitlag frame except the last, pressing L or R will be treated as pressing it repeatedly every frame of hitlag, thus instantly cancelling the tech window and incurring lockout
Sourcepub fn just_pressed(&self) -> bool
pub fn just_pressed(&self) -> bool
Returns true if the player was not pressing last frame, but is pressing this frame.
Sourcepub fn lockout_window(&self) -> i32
pub fn lockout_window(&self) -> i32
Returns the current lockout window in frames. Negative values mean the lockout window is closed
Sourcepub fn frames_since_input(&self) -> i32
pub fn frames_since_input(&self) -> i32
Returns the number of frames since L or R was last input. Always a negative number.
Trait Implementations§
Source§impl Debug for LockoutTracker
impl Debug for LockoutTracker
Source§impl Default for LockoutTracker
impl Default for LockoutTracker
Source§fn default() -> LockoutTracker
fn default() -> LockoutTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LockoutTracker
impl RefUnwindSafe for LockoutTracker
impl Send for LockoutTracker
impl Sync for LockoutTracker
impl Unpin for LockoutTracker
impl UnwindSafe for LockoutTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more