Class TileInfo
- Namespace
- MoonBark.GridPlacement.Core.Types
- Assembly
- MoonBark.GridPlacement.Core.dll
Information about a tile in the grid. Combines data from TileMapLayer and ECS occupancy.
public record TileInfo : IEquatable<TileInfo>
- Inheritance
-
TileInfo
- Implements
- Inherited Members
Fields
TypeEmpty
Tile type for empty (no tile data) positions.
public const string TypeEmpty = "Empty"
Field Value
TypeMapCell
Tile type for positions with a TileMap cell but no named type.
public const string TypeMapCell = "TileMapCell"
Field Value
Properties
AlternativeTile
Alternative tile ID (for tile variations).
public int AlternativeTile { get; init; }
Property Value
AtlasCoords
Atlas coordinates in the tile set.
public CoreVector2I AtlasCoords { get; init; }
Property Value
- CoreVector2I
GridPosition
Grid position of the tile.
public CoreVector2I GridPosition { get; init; }
Property Value
- CoreVector2I
HasTileData
Whether a TileMapLayer has data at this position.
public bool HasTileData { get; }
Property Value
IsBuildable
Whether the tile has a foundation and can be built upon. True when a TileMap cell exists at this position (tileSourceId >= 0). Ground tiles = buildable foundation.
public bool IsBuildable { get; init; }
Property Value
IsOccupied
Whether the tile is occupied by an ECS entity.
public bool IsOccupied { get; init; }
Property Value
ObjectAtPosition
Information about a placed object at this position (if any).
public ObjectInfo? ObjectAtPosition { get; init; }
Property Value
TileSourceId
TileSet source ID (-1 if no tile).
public int TileSourceId { get; init; }
Property Value
TileType
Type of tile (e.g., "TileMapCell", "Empty").
public string TileType { get; init; }
Property Value
WorldPosition
World position of the tile center.
public CoreVector2 WorldPosition { get; init; }
Property Value
- CoreVector2
Methods
Empty(CoreVector2I, CoreVector2)
Creates an empty TileInfo for a position.
public static TileInfo Empty(CoreVector2I gridPosition, CoreVector2 worldPosition)
Parameters
gridPositionCoreVector2IworldPositionCoreVector2