Skip to main content

World

Struct World 

Source
pub struct World {
Show 21 fields pub map_name: String, pub sectors: Vec<Sector>, pub walls: Vec<Wall>, pub sprites: Vec<Sprite>, pub rt: Vec<SpriteRt>, pub xsectors: Vec<XSector>, pub xwalls: Vec<XWall>, pub xsprites: Vec<XSprite>, pub sky_offsets: Vec<i16>, pub sky_bits: i32, pub visibility: i32, pub song_id: i32, pub base_floor: Vec<i32>, pub base_ceil: Vec<i32>, pub base_wall_xy: Vec<(i32, i32)>, pub base_sprite_xy: Vec<(i32, i32, i32)>, pub base_floor_shade: Vec<i8>, pub base_ceil_shade: Vec<i8>, pub base_wall_shade: Vec<i8>, pub links: Vec<Ror>, pub ror_view: Vec<Ror>,
}

Fields§

§map_name: String§sectors: Vec<Sector>§walls: Vec<Wall>§sprites: Vec<Sprite>§rt: Vec<SpriteRt>§xsectors: Vec<XSector>§xwalls: Vec<XWall>§xsprites: Vec<XSprite>§sky_offsets: Vec<i16>§sky_bits: i32§visibility: i32§song_id: i32§base_floor: Vec<i32>

Original floor/ceiling heights, used by movers.

§base_ceil: Vec<i32>§base_wall_xy: Vec<(i32, i32)>

Original wall vertices, used by sliding/rotating sectors.

§base_sprite_xy: Vec<(i32, i32, i32)>§base_floor_shade: Vec<i8>

Original shades, used by sector lighting effects.

§base_ceil_shade: Vec<i8>§base_wall_shade: Vec<i8>§links: Vec<Ror>

Floor/ceiling links between stacked rooms (all marker kinds, used for movement).

§ror_view: Vec<Ror>

The subset of links you can see through (stacks and generic links; water is opaque).

Implementations§

Source§

impl World

Source

pub fn from_map(name: &str, m: Map) -> Self

Source

pub fn xsector(&self, s: usize) -> Option<&XSector>

Source

pub fn xsector_mut(&mut self, s: usize) -> Option<&mut XSector>

Source

pub fn xwall(&self, w: usize) -> Option<&XWall>

Source

pub fn xwall_mut(&mut self, w: usize) -> Option<&mut XWall>

Source

pub fn xsprite(&self, s: usize) -> Option<&XSprite>

Source

pub fn xsprite_mut(&mut self, s: usize) -> Option<&mut XSprite>

Source

pub fn zs_at(&self, sect: usize, x: f64, y: f64) -> (f64, f64)

Source

pub fn sector_walls(&self, s: usize) -> Range<usize> ⓘ

Source

pub fn spawn(&mut self, s: Sprite) -> usize

Spawns a new sprite (reusing freed slots) and returns its index.

Source

pub fn delete_sprite(&mut self, i: usize)

Source

pub fn with_stat(&self, st: i16) -> Vec<usize>

Sprite indices with the given status number.

Pairs Blood’s room-over-room markers. Odd types (7 link, 9 water, 11 stack, 13 goo) sit in the upper room and make its floor a portal; the even partner (6, 10, 12, 14) sits in the lower room and makes its ceiling a portal. Partners share data1.

Source

pub fn player_start(&self, player: i32) -> Option<&Sprite>

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for World

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for World

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for World

§

impl RefUnwindSafe for World

§

impl Send for World

§

impl Sync for World

§

impl Unpin for World

§

impl UnsafeUnpin for World

§

impl UnwindSafe for World

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.