VersionSpecs

Struct VersionSpecs 

Source
pub struct VersionSpecs { /* private fields */ }
Expand description

Version specs of the level data (seperate from the lparse file version)

Implementations§

Source§

impl VersionSpecs

Source

pub fn from_version(version: u32) -> Result<Self, Error>

Creates it from a specific level file version Only current level format in CNM Online is ID 1.

Source

pub fn get_version(&self) -> u32

Version ID

Source

pub fn get_num_teleports(&self) -> usize

Maximum number of teleports supported

Source

pub fn get_num_spawns(&self) -> usize

Maximum number of spawns per mode (there are 2 modes used, 1 unused) Those modes being, player spawns, checkpoints, and an unused mode.

Source

pub fn get_num_spawn_modes(&self) -> usize

Number of spawner modes.

Source

pub fn get_teleport_name_size(&self) -> usize

Maximum size of a teleport name in bytes. All names in CNM Online are ascii.

Source

pub fn get_max_tile_frames(&self) -> usize

Maximum amount of frames an animated tile can have in CNM Online

Source

pub fn get_ending_text_lines(&self) -> usize

Number of text lines saved in CNMS files.

Source

pub fn get_ending_text_line_len(&self) -> usize

The length of each CNMS text line in bytes.

Source

pub fn get_background_layers(&self) -> usize

The maximum amount of background layers this version supports.

Source

pub fn get_title_ending_text_line(&self) -> usize

What text line the title is on in this version

Source

pub fn get_preview_tile_index(&self) -> usize

What tile index controls the preview for a level in this version

Trait Implementations§

Source§

impl Debug for VersionSpecs

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VersionSpecs

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 VersionSpecs

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§

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

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.
Source§

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