Skip to main content

TileSetPropertyId

Trait TileSetPropertyId 

Source
pub trait TileSetPropertyId {
    type Property: TryFrom<TileSetPropertyValue, Error = TilePropertyError> + Default;

    // Required method
    fn property_uuid(&self) -> &Uuid;

    // Provided methods
    fn get_from_tile_map(
        &self,
        tile_map: &TileMap,
        position: Vector2<i32>,
    ) -> Result<Self::Property, TilePropertyError> { ... }
    fn get_from_tile_set(
        &self,
        tile_set: &TileSet,
        handle: TileDefinitionHandle,
    ) -> Result<Self::Property, TilePropertyError> { ... }
}
Expand description

Trait for objects that identify a tile set property of a particular type.

Required Associated Types§

Source

type Property: TryFrom<TileSetPropertyValue, Error = TilePropertyError> + Default

The type of the values of the property.

Required Methods§

Source

fn property_uuid(&self) -> &Uuid

The UUID of the property.

Provided Methods§

Source

fn get_from_tile_map( &self, tile_map: &TileMap, position: Vector2<i32>, ) -> Result<Self::Property, TilePropertyError>

The value of the property at the given cell of the given tile map.

Source

fn get_from_tile_set( &self, tile_set: &TileSet, handle: TileDefinitionHandle, ) -> Result<Self::Property, TilePropertyError>

The value of the property at the given handle in the given tile set.

Implementors§