pub struct EdgeUnlockAnim {
pub from: TreeCoord,
pub to: TreeCoord,
pub ticks: u32,
pub gates_destination: bool,
}Expand description
In-flight “path lights up” animation when a buy lights an edge.
Lives only at runtime — #[serde(skip)]-projected fields don’t ever
reach disk.
gates_destination is true when the buy newly made the destination
reachable — those destinations are held in “not yet reachable” UX
until the wave arrives, and get the gold unlock_flash on completion.
Edges to already-reachable neighbors animate decoratively (so every
newly-lit edge gets the snake) but DON’T gate the destination, since
the player was free to buy it before this animation started.
Wave geometry (leading_inside / trailing_inside / visible length)
is computed lazily against node::edge_path_cells(from, to), which
returns a canonical lo→hi-ordered path. Caching the offsets on the
anim would couple them to the call-site direction; under a renderer
that iterated the edge in the opposite (a, b) order they pointed at
the wrong end of the line.
Fields§
§from: TreeCoord§to: TreeCoord§ticks: u32§gates_destination: boolImplementations§
Source§impl EdgeUnlockAnim
impl EdgeUnlockAnim
Sourcepub fn visible_advance(&self) -> usize
pub fn visible_advance(&self) -> usize
Visible-cell offset of the wavefront — how many cells past the source-side leading-inside region the head has advanced.
Trait Implementations§
Source§impl Clone for EdgeUnlockAnim
impl Clone for EdgeUnlockAnim
Source§fn clone(&self) -> EdgeUnlockAnim
fn clone(&self) -> EdgeUnlockAnim
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EdgeUnlockAnim
impl Debug for EdgeUnlockAnim
impl Copy for EdgeUnlockAnim
Auto Trait Implementations§
impl Freeze for EdgeUnlockAnim
impl RefUnwindSafe for EdgeUnlockAnim
impl Send for EdgeUnlockAnim
impl Sync for EdgeUnlockAnim
impl Unpin for EdgeUnlockAnim
impl UnsafeUnpin for EdgeUnlockAnim
impl UnwindSafe for EdgeUnlockAnim
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more