Table of Contents

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

string

TypeMapCell

Tile type for positions with a TileMap cell but no named type.

public const string TypeMapCell = "TileMapCell"

Field Value

string

Properties

AlternativeTile

Alternative tile ID (for tile variations).

public int AlternativeTile { get; init; }

Property Value

int

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

bool

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

bool

IsOccupied

Whether the tile is occupied by an ECS entity.

public bool IsOccupied { get; init; }

Property Value

bool

ObjectAtPosition

Information about a placed object at this position (if any).

public ObjectInfo? ObjectAtPosition { get; init; }

Property Value

ObjectInfo

TileSourceId

TileSet source ID (-1 if no tile).

public int TileSourceId { get; init; }

Property Value

int

TileType

Type of tile (e.g., "TileMapCell", "Empty").

public string TileType { get; init; }

Property Value

string

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

gridPosition CoreVector2I
worldPosition CoreVector2

Returns

TileInfo