15 lines
513 B
C#
15 lines
513 B
C#
namespace Just.Core.Collections;
|
|
|
|
/// <summary>Read-only interface for a 2D grid with coordinate-based access and enumeration.</summary>
|
|
/// <typeparam name="T">The type of elements in the map.</typeparam>
|
|
public interface IMap<T> : IReadOnlyCollection<MapPoint<T>>
|
|
{
|
|
int Width { get; }
|
|
int Height { get; }
|
|
ref readonly T this[int x, int y] { get; }
|
|
ref readonly T this[double x, double y] { get; }
|
|
MapPoint<T> Get(int x, int y);
|
|
MapPoint<T> Get(double x, double y);
|
|
T[,] ToArray();
|
|
}
|