pub struct Triggers {
pub tick: u64,
events: Vec<Event>,
busy: Vec<Busy>,
rx_index: HashMap<u32, Vec<Obj>>,
vertex_group: Vec<Vec<usize>>,
frozen_slides: HashSet<usize>,
pub notices: Vec<Notice>,
pub carries: Vec<Carry>,
xforms: HashMap<usize, Xform>,
init_state: HashMap<usize, f64>,
pub secrets_total: i32,
pub secrets_found: i32,
}Fields§
§tick: u64§events: Vec<Event>§busy: Vec<Busy>§rx_index: HashMap<u32, Vec<Obj>>§vertex_group: Vec<Vec<usize>>Vertex groups: walls sharing a position (for moving shared vertices together).
frozen_slides: HashSet<usize>Slide sectors whose walls stay put: moving them would fold a sector over itself (E1M1’s coffin), which the original never shows.
notices: Vec<Notice>§carries: Vec<Carry>Sector movements since the game last consumed them (to carry the player).
xforms: HashMap<usize, Xform>§init_state: HashMap<usize, f64>§secrets_total: i32§secrets_found: i32Implementations§
Source§impl Triggers
impl Triggers
pub fn new(world: &World) -> Self
Sourcepub fn rebuild(&mut self, world: &World)
pub fn rebuild(&mut self, world: &World)
Recomputes lookup tables that are not saved (receive index, shared vertices).
Sourcepub fn frozen_slides(&self) -> Vec<usize>
pub fn frozen_slides(&self) -> Vec<usize>
Slide sectors left in place because moving them would fold geometry.
Sourcefn find_folding_slides(&self, world: &World) -> HashSet<usize>
fn find_folding_slides(&self, world: &World) -> HashSet<usize>
Slide sectors whose full travel would make some sector polygon self-intersecting.
pub fn reindex(&mut self, world: &World)
Sourcepub fn init_level(&mut self, world: &mut World)
pub fn init_level(&mut self, world: &mut World)
Initial pass after loading: apply start states and count secrets.
pub fn post(&mut self, obj: Obj, cmd: u8, delay_ticks: u64)
fn state_of(world: &World, o: Obj) -> Option<(u8, bool)>
fn set_locked(world: &mut World, o: Obj, v: Option<bool>)
fn busy_ticks(world: &World, o: Obj, target: u8) -> u32
fn current_busy(world: &World, o: Obj) -> u32
fn set_busy(world: &mut World, o: Obj, b: u32)
fn set_state(&mut self, world: &mut World, o: Obj, target: u8)
fn reach_state(&mut self, world: &mut World, o: Obj, st: u8)
pub fn is_busy(&self, o: Obj) -> bool
Sourcepub fn apply_sector(&mut self, world: &mut World, s: usize, f: f64)
pub fn apply_sector(&mut self, world: &mut World, s: usize, f: f64)
Positions a moving sector for interpolation factor f (0 = off, 1 = on).
Sourcefn apply_z(world: &mut World, s: usize, x: &XSector, f: f64)
fn apply_z(world: &mut World, s: usize, x: &XSector, f: f64)
Interpolates floor/ceiling between the x-sector’s off and on heights, carrying sprites that rest on the floor.
fn moved_walls(world: &World, s: usize, marked: bool) -> Vec<(usize, i32)>
fn initial_state(&mut self, world: &World, s: usize) -> f64
Sourcefn carry(&mut self, world: &mut World, s: usize, new: Xform)
fn carry(&mut self, world: &mut World, s: usize, new: Xform)
Moves sprites standing in a moving sector by the change from its previous transform, and records the change so the game can carry the player too.
fn translate_sector( &mut self, world: &mut World, s: usize, dx: i32, dy: i32, marked: bool, )
fn rotate_sector( &mut self, world: &mut World, s: usize, cx: i32, cy: i32, a: f64, marked: bool, )
Sourcepub fn push_wall(&mut self, world: &mut World, w: usize) -> bool
pub fn push_wall(&mut self, world: &mut World, w: usize) -> bool
Player pressed “use” on a wall (and possibly the sector behind it).
pub fn push_sprite(&mut self, world: &mut World, s: usize) -> bool
pub fn push_sector(&mut self, world: &mut World, s: usize) -> bool
pub fn enter_sector(&mut self, world: &mut World, s: usize)
pub fn exit_sector(&mut self, world: &mut World, s: usize)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Triggers
impl<'de> Deserialize<'de> for Triggers
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Triggers
impl RefUnwindSafe for Triggers
impl Send for Triggers
impl Sync for Triggers
impl Unpin for Triggers
impl UnsafeUnpin for Triggers
impl UnwindSafe for Triggers
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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