Skip to content

TilemapPropertyExtensions Class

Definition

Namespace: Brine2D.Tilemap

Typed accessors for Tiled property dictionaries on maps, layers, objects, and tiles. All values come back as strings after loading; these helpers handle the parsing.

C#
public static class TilemapPropertyExtensions

Inheritance System.Object → TilemapPropertyExtensions

Methods
Get<T>\(this Dictionary<string,string>, string, T\) Returns the property value as T, or defaultValue if the key is missing or can't be parsed.
GetColor\(this Dictionary<string,string>, string, Color\) Returns the property value as a Color parsed from a Tiled color string (#RRGGBB or #AARRGGBB), or defaultValue if the key is missing or the format isn't recognised.
TryGet<T>\(this Dictionary<string,string>, string, T\) Returns true and sets value if the key exists and can be parsed as T.