pub struct Level {
pub version: Version,
pub link: u32,
pub integrity: [f64; 4],
pub title: String,
pub lgr: String,
pub ground: String,
pub sky: String,
pub polygons: Vec<Polygon>,
pub objects: Vec<Object>,
pub pictures: Vec<Picture>,
pub best_times: BestTimes,
}Expand description
Level struct that contains all level information.
Fields§
§version: VersionElma or Across level.
link: u32Random number that links level file to replay files.
integrity: [f64; 4]Contains four integrity checks.
title: StringLevel title.
lgr: StringLGR file name.
ground: StringGround texture name.
sky: StringSky texture name.
polygons: Vec<Polygon>Vector with all polygons (See Polygon).
objects: Vec<Object>Vector with all objects (See Object).
pictures: Vec<Picture>Vector with all pictures (See Picture).
best_times: BestTimesBest times lists.
Implementations§
Source§impl Level
impl Level
Sourcepub fn load<P: Into<PathBuf>>(path: P) -> Result<Self, ElmaError>
pub fn load<P: Into<PathBuf>>(path: P) -> Result<Self, ElmaError>
Loads a level file and returns a Level struct.
§Examples
let level = Level::load("tests/assets/levels/test_1.lev").unwrap();Sourcepub fn check_topology(&self) -> Result<(), TopologyError>
pub fn check_topology(&self) -> Result<(), TopologyError>
Check topology of level.
Sourcepub fn generate_link(&mut self)
pub fn generate_link(&mut self)
Generate a random link number. When you save a level, it will keep the original link number unless explicitly changed manually or by running this function before saving.
§Examples
let mut level = Level::new();
level.generate_link();
level.save("newlink.lev", Top10Save::No).unwrap();Trait Implementations§
Source§impl BoundingBox for Level
impl BoundingBox for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
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
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>
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 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>
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