Struct wad::wad::WadData

source ·
pub struct WadData {
    pub(crate) lumps: Vec<Lump>,
}
Expand description

“Where’s All (the) Data”: contains the WAD in memory, plus an array of directories telling us where each data lump starts

Fields§

§lumps: Vec<Lump>

Implementations§

source§

impl WadData

source

pub fn new(file_path: PathBuf) -> WadData

source

pub fn add_file(&mut self, file_path: PathBuf)

source

fn read_header(file: &[u8]) -> WadHeader

source

fn read_dir_data(ofs: usize, file: &[u8]) -> Lump

source

fn cache_lumps(&mut self, file: &[u8])

source

pub fn get_lump(&self, name: &str) -> Option<&Lump>

Find a general lump by name

source

pub(crate) fn find_lump_or_panic(&self, name: &str) -> &Lump

Find a general lump by name

source

pub(crate) fn find_lump_for_map_or_panic( &self, map_name: &str, lump: MapLump ) -> &Lump

Find the map name and adds the desired lump offset

source

pub fn lump_exists(&self, lump_name: &str) -> bool

source§

impl WadData

source

pub fn flats_iter( &self ) -> LumpIter<'_, WadFlat, impl Fn(&Lump) -> WadFlat + '_>

source

pub fn sprites_iter( &self ) -> LumpIter<'_, WadPatch, impl Fn(&Lump) -> WadPatch + '_>

source

pub fn playpal_iter( &self ) -> OffsetIter<WadPalette, impl Fn(usize) -> WadPalette + '_>

source

pub fn colourmap_iter(&self) -> OffsetIter<u8, impl Fn(usize) -> u8 + '_>

source

pub fn pnames_iter(&self) -> OffsetIter<String, impl Fn(usize) -> String + '_>

source

pub fn patches_iter(&self) -> PatchIter<'_>

Iterate over patches in order determined by PNAME lump

source

pub fn texture_iter( &self, name: &str ) -> OffsetIter<WadTexture, impl Fn(usize) -> WadTexture + '_>

Producer for the base texture data. This returns WadTexture which includes data on how the patches are put together to form a texture.

source

pub fn thing_iter( &self, map_name: &str ) -> OffsetIter<WadThing, impl Fn(usize) -> WadThing + '_>

source

pub fn vertex_iter( &self, map_name: &str ) -> OffsetIter<WadVertex, impl Fn(usize) -> WadVertex + '_>

source

pub fn sector_iter( &self, map_name: &str ) -> OffsetIter<WadSector, impl Fn(usize) -> WadSector + '_>

source

pub fn sidedef_iter( &self, map_name: &str ) -> OffsetIter<WadSideDef, impl Fn(usize) -> WadSideDef + '_>

source

pub fn linedef_iter( &self, map_name: &str ) -> OffsetIter<WadLineDef, impl Fn(usize) -> WadLineDef + '_>

source

pub fn segment_iter( &self, map_name: &str ) -> OffsetIter<WadSegment, impl Fn(usize) -> WadSegment + '_>

source

pub fn subsector_iter( &self, map_name: &str ) -> OffsetIter<WadSubSector, impl Fn(usize) -> WadSubSector + '_>

source

pub fn node_iter( &self, map_name: &str ) -> OffsetIter<WadNode, impl Fn(usize) -> WadNode + '_>

Trait Implementations§

source§

impl Debug for WadData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.