using System.Collections.Generic; using Microsoft.Xna.Framework.Graphics; namespace MonoGame.Extended.Tilemaps { /// /// Represents metadata and properties for a specific tile in a tileset. /// /// /// Tile data contains information such as custom properties, animations, /// collision shapes, and custom images for individual tiles. /// public class TilemapTileData { /// /// Gets the local tile ID within the tileset. /// public int LocalId { get; } /// /// Gets or sets the class/type identifier for the tile. /// public string Class { get; set; } = string.Empty; /// /// Gets or sets the probability of this tile being used in random tile generation. /// /// A value between 0.0 and 1.0, where 1.0 is the default probability. public float Probability { get; set; } /// /// Gets the custom properties of the tile. /// public TilemapProperties Properties { get; } /// /// Gets or sets the animation data for animated tiles. /// public TilemapTileAnimation Animation { get; set; } /// /// Gets the collision objects associated with this tile. /// /// /// Collision objects define the collision shape(s) for the tile and will be /// integrated with the 2D collision system. /// public List CollisionObjects { get; } /// /// Gets or sets a custom image texture for this tile. /// /// /// When set, this texture overrides the tileset's atlas texture for this specific tile. /// public Texture2D CustomImage { get; set; } /// /// Initializes a new instance of the class. /// /// The local tile ID within the tileset. public TilemapTileData(int localId) { LocalId = localId; Properties = new TilemapProperties(); CollisionObjects = new List(); Probability = 1.0f; } } }