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
tileTypeIdTileTypeIdThe semantic tile type identifier.
Fields
None
Represents no tile data (empty/invalid state).
public static readonly TileSourceData None
Field Value
Properties
HasValue
Whether this tile source data is valid (has a non-empty TileTypeId).
public bool HasValue { get; }
Property Value
TileTypeId
The semantic tile type identifier. Maps to (TileSetId, SourceId, AtlasCoords) via TileTypeMapping in Godot layer.
public TileTypeId TileTypeId { get; }
Property Value
Methods
Equals(TileSourceData)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(TileSourceData other)
Parameters
otherTileSourceDataAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
tileTypeIdValuestringThe string value of the tile type ID.
Returns
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
leftTileSourceDatarightTileSourceData
Returns
operator !=(TileSourceData, TileSourceData)
public static bool operator !=(TileSourceData left, TileSourceData right)
Parameters
leftTileSourceDatarightTileSourceData