Skip to main content

TileConfig

Struct TileConfig 

Source
pub struct TileConfig {
Show 29 fields pub ground: TileTypeDef, pub dirt: TileTypeDef, pub sand: TileTypeDef, pub mud: TileTypeDef, pub liquid: TileTypeDef, pub deep_water: TileTypeDef, pub rocky_ground: TileTypeDef, pub grass: TileTypeDef, pub debris: TileTypeDef, pub wall: TileTypeDef, pub wall_vert: TileTypeDef, pub wall_horiz: TileTypeDef, pub door_closed: TileTypeDef, pub door_open: TileTypeDef, pub stairs_up: TileTypeDef, pub stairs_down: TileTypeDef, pub bridge: TileTypeDef, pub boulder: TileTypeDef, pub chest: TileTypeDef, pub crate_obj: TileTypeDef, pub shrine: TileTypeDef, pub bed: TileTypeDef, pub consumable: TileTypeDef, pub currency: TileTypeDef, pub key_item: TileTypeDef, pub unknown_obj: TileTypeDef, pub hazard: TileTypeDef, pub smoke: TileTypeDef, pub custom: HashMap<String, TileTypeDef>,
}
Expand description

Tile ID (u16) mappings, movement costs, and collision rules.

Defaults match the constants in tile.rs:

  • Ground layer: . , : ` ~ = b ; '
  • Structure layer: # | _ I * ^ v
  • Object layer: o C c S B ! $ K ?
  • Effect layer: x %

Fields§

§ground: TileTypeDef

Ground tile: b’.’ — open floor. Cost 1, passable, transparent.

§dirt: TileTypeDef

Dirt tile: b’,’ — soft earth. Cost 1, passable, transparent.

§sand: TileTypeDef

Sand tile: b’:’ — loose sand. Cost 2, passable, transparent.

§mud: TileTypeDef

Mud tile: b’`’ — wet ground. Cost 2, passable, transparent.

§liquid: TileTypeDef

Liquid tile: b’~’ — shallow water. Cost 3, passable, transparent.

§deep_water: TileTypeDef

Deep water tile: b’=’ — impassable water. Cost 999, blocks move, transparent.

§rocky_ground: TileTypeDef

Rocky ground tile: b’b’ — rough terrain. Cost 2, passable, transparent.

§grass: TileTypeDef

Grass tile: b’;’ — grass. Cost 2, passable, transparent.

§debris: TileTypeDef

Debris tile: b’'’ — rubble. Cost 2, passable, transparent.

§wall: TileTypeDef

Wall tile: b’#’ — solid wall. Cost 999, blocks move, blocks sight.

§wall_vert: TileTypeDef

Vertical wall tile: b’|’ — vertical wall segment. Cost 999, blocks move, blocks sight.

§wall_horiz: TileTypeDef

Horizontal wall tile: b’_’ — horizontal wall segment. Cost 999, blocks move, blocks sight.

§door_closed: TileTypeDef

Closed door tile: b’I’ — closed door. Cost 999, blocks move, blocks sight.

§door_open: TileTypeDef

Open door tile: b’*’ — open door. Cost 1, passable, transparent.

§stairs_up: TileTypeDef

Stairs up tile: b’^’ — ascending stairs. Cost 1, passable, transparent.

§stairs_down: TileTypeDef

Stairs down tile: b’v’ — descending stairs. Cost 1, passable, transparent.

§bridge: TileTypeDef

Bridge tile: b’=’ — walkable bridge. Cost 1, passable, transparent.

§boulder: TileTypeDef

Boulder tile: b’o’ — large rock. Cost 999, blocks move, blocks sight.

§chest: TileTypeDef

Chest tile: b’C’ — closed chest. Cost 999, blocks move, transparent.

§crate_obj: TileTypeDef

Crate tile: b’c’ — wooden crate. Cost 999, blocks move, transparent.

§shrine: TileTypeDef

Shrine tile: b’S’ — interactive shrine. Cost 1, passable, transparent.

§bed: TileTypeDef

Bed tile: b’B’ — bed. Cost 999, blocks move, transparent.

§consumable: TileTypeDef

Consumable tile: b’!’ — pickup item. Cost 1, passable, transparent.

§currency: TileTypeDef

Currency tile: b’$’ — gold drop. Cost 1, passable, transparent.

§key_item: TileTypeDef

Key item tile: b’K’ — quest item pickup. Cost 1, passable, transparent.

§unknown_obj: TileTypeDef

Unknown object tile: b’?’ — unidentified. Cost 999, blocks move, transparent.

§hazard: TileTypeDef

Hazard tile: b’x’ — environmental hazard. Cost 2, passable, transparent.

§smoke: TileTypeDef

Smoke tile: b’%’ — obscuring smoke. Cost 2, passable, blocks sight.

§custom: HashMap<String, TileTypeDef>

Additional custom tile definitions. Key = tile name, value = definition.

Trait Implementations§

Source§

impl Clone for TileConfig

Source§

fn clone(&self) -> TileConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TileConfig

Source§

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

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

impl Default for TileConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TileConfig

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 TileConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

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