Table of Contents

Struct TileSourceData

Namespace
MoonBark.GridPlacement.Core.Types
Assembly
MoonBark.GridPlacement.Core.dll

Tile source data for TileMap synchronization. Contains the semantic tile type ID that maps to Godot tile coordinates.

Core concept: This struct holds the semantic TileTypeId. The Godot layer (via TileTypeMapping) resolves this to (TileSetId, SourceId, AtlasCoords) when actually setting tiles in a TileMapLayer.

The name "TileSourceData" is kept for API compatibility, but the content is now Core-agnostic - only TileTypeId is stored.

public readonly struct TileSourceData : IEquatable<TileSourceData>
Implements
Inherited Members

Constructors

TileSourceData(TileTypeId)

Creates a new TileSourceData instance.

public TileSourceData(TileTypeId tileTypeId)

Parameters

tileTypeId TileTypeId

The semantic tile type identifier.

Fields

None

Represents no tile data (empty/invalid state).

public static readonly TileSourceData None

Field Value

TileSourceData

Properties

HasValue

Whether this tile source data is valid (has a non-empty TileTypeId).

public bool HasValue { get; }

Property Value

bool

TileTypeId

The semantic tile type identifier. Maps to (TileSetId, SourceId, AtlasCoords) via TileTypeMapping in Godot layer.

public TileTypeId TileTypeId { get; }

Property Value

TileTypeId

Methods

Equals(TileSourceData)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(TileSourceData other)

Parameters

other TileSourceData

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

FromString(string)

Creates a new TileSourceData instance from a string tile type ID.

public static TileSourceData FromString(string tileTypeIdValue)

Parameters

tileTypeIdValue string

The string value of the tile type ID.

Returns

TileSourceData

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(TileSourceData, TileSourceData)

public static bool operator ==(TileSourceData left, TileSourceData right)

Parameters

left TileSourceData
right TileSourceData

Returns

bool

operator !=(TileSourceData, TileSourceData)

public static bool operator !=(TileSourceData left, TileSourceData right)

Parameters

left TileSourceData
right TileSourceData

Returns

bool