documentation update
This commit is contained in:
@@ -3,6 +3,11 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Just.Core.Collections;
|
||||
|
||||
/// <summary>
|
||||
/// A 2D grid with lazy min/max caching, cloning, and binary stream serialization.
|
||||
/// Requires <typeparamref name="T"/> to support comparison and equality operators.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The element type; must implement <c>IComparisonOperators<T, T, bool></c> and <c>IEqualityOperators<T, T, bool></c>.</typeparam>
|
||||
public class DataMap<T> : Map<T>, IDataMap<T>, ICloneable
|
||||
where T : IComparisonOperators<T, T, bool>, IEqualityOperators<T, T, bool>
|
||||
{
|
||||
|
||||
@@ -2,6 +2,8 @@ using System.Numerics;
|
||||
|
||||
namespace Just.Core.Collections;
|
||||
|
||||
/// <summary>Read-only interface for a 2D grid with min/max tracking and cloning.</summary>
|
||||
/// <typeparam name="T">The element type; must support comparison and equality operators.</typeparam>
|
||||
public interface IDataMap<T> : IMap<T>, ICloneable
|
||||
where T : IComparisonOperators<T, T, bool>, IEqualityOperators<T, T, bool>
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
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; }
|
||||
|
||||
@@ -2,6 +2,11 @@ using System.Collections;
|
||||
|
||||
namespace Just.Core.Collections;
|
||||
|
||||
/// <summary>
|
||||
/// A 2D grid container providing indexer access, enumeration as <see cref="MapPoint{T}"/> values,
|
||||
/// and conversion to a 2D array. Coordinates are clamped to valid ranges.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of elements in the map.</typeparam>
|
||||
public class Map<T> : IMap<T>
|
||||
{
|
||||
internal readonly T[] _values;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
namespace Just.Core.Collections;
|
||||
|
||||
/// <summary>A value and its coordinates within a <see cref="IMap{T}"/>.</summary>
|
||||
/// <typeparam name="T">The type of the map element.</typeparam>
|
||||
public readonly struct MapPoint<T>(T value, int x, int y, IMap<T> map)
|
||||
{
|
||||
public readonly T Value = value;
|
||||
|
||||
Reference in New Issue
Block a user