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§
Sourcetype Property: TryFrom<TileSetPropertyValue, Error = TilePropertyError> + Default
type Property: TryFrom<TileSetPropertyValue, Error = TilePropertyError> + Default
The type of the values of the property.
Required Methods§
Sourcefn property_uuid(&self) -> &Uuid
fn property_uuid(&self) -> &Uuid
The UUID of the property.
Provided Methods§
Sourcefn get_from_tile_map(
&self,
tile_map: &TileMap,
position: Vector2<i32>,
) -> Result<Self::Property, TilePropertyError>
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.
Sourcefn get_from_tile_set(
&self,
tile_set: &TileSet,
handle: TileDefinitionHandle,
) -> Result<Self::Property, TilePropertyError>
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.