Show / Hide Table of Contents

Class AutoSyncSpatialMap<T>

A version of SpatialMap<T> which takes items that implement IPositionable, and uses that interface's properties/events to automatically ensure items are recorded at the proper positions in the spatial map when they move and that the position fields are updated if the spatial map's move functions are used.

Inheritance
Object
AutoSyncAdvancedSpatialMap<T>
AutoSyncSpatialMap<T>
Implements
ISpatialMap<T>
IReadOnlySpatialMap<T>
IEnumerable<ItemPositionPair<T>>
IEnumerable
Inherited Members
AutoSyncAdvancedSpatialMap<T>.GetEnumerator()
AutoSyncAdvancedSpatialMap<T>.AsReadOnly()
AutoSyncAdvancedSpatialMap<T>.CanAdd(T)
AutoSyncAdvancedSpatialMap<T>.CanAdd(T, Point)
AutoSyncAdvancedSpatialMap<T>.CanAdd(T, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.Add(T)
AutoSyncAdvancedSpatialMap<T>.Add(T, Point)
AutoSyncAdvancedSpatialMap<T>.Add(T, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.TryAdd(T)
AutoSyncAdvancedSpatialMap<T>.TryAdd(T, Point)
AutoSyncAdvancedSpatialMap<T>.TryAdd(T, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.CanMove(T, Point)
AutoSyncAdvancedSpatialMap<T>.CanMove(T, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.CanMoveAll(Point, Point)
AutoSyncAdvancedSpatialMap<T>.CanMoveAll(Int32, Int32, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.Move(T, Point)
AutoSyncAdvancedSpatialMap<T>.Move(T, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.TryMove(T, Point)
AutoSyncAdvancedSpatialMap<T>.TryMove(T, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.MoveAll(Point, Point)
AutoSyncAdvancedSpatialMap<T>.TryMoveAll(Point, Point)
AutoSyncAdvancedSpatialMap<T>.MoveAll(Int32, Int32, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.TryMoveAll(Int32, Int32, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.MoveValid(Point, Point)
AutoSyncAdvancedSpatialMap<T>.MoveValid(Point, Point, List<T>)
AutoSyncAdvancedSpatialMap<T>.MoveValid(Int32, Int32, Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.MoveValid(Int32, Int32, Int32, Int32, List<T>)
AutoSyncAdvancedSpatialMap<T>.Contains(T)
AutoSyncAdvancedSpatialMap<T>.Contains(Point)
AutoSyncAdvancedSpatialMap<T>.Contains(Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.GetItemsAt(Point)
AutoSyncAdvancedSpatialMap<T>.GetItemsAt(Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.GetPositionOfOrNull(T)
AutoSyncAdvancedSpatialMap<T>.TryGetPositionOf(T, Point)
AutoSyncAdvancedSpatialMap<T>.GetPositionOf(T)
AutoSyncAdvancedSpatialMap<T>.GetItem(Point)
AutoSyncAdvancedSpatialMap<T>.GetItem(Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.GetItemOrDefault(Point)
AutoSyncAdvancedSpatialMap<T>.GetItemOrDefault(Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.ToString(Func<T, String>)
AutoSyncAdvancedSpatialMap<T>.ToString()
AutoSyncAdvancedSpatialMap<T>.Clear()
AutoSyncAdvancedSpatialMap<T>.Remove(T)
AutoSyncAdvancedSpatialMap<T>.TryRemove(T)
AutoSyncAdvancedSpatialMap<T>.Remove(Point)
AutoSyncAdvancedSpatialMap<T>.TryRemove(Point)
AutoSyncAdvancedSpatialMap<T>.Remove(Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.TryRemove(Int32, Int32)
AutoSyncAdvancedSpatialMap<T>.Count
AutoSyncAdvancedSpatialMap<T>.Items
AutoSyncAdvancedSpatialMap<T>.Positions
AutoSyncAdvancedSpatialMap<T>.ItemAdded
AutoSyncAdvancedSpatialMap<T>.ItemMoved
AutoSyncAdvancedSpatialMap<T>.ItemRemoved
Namespace: SadRogue.Primitives.SpatialMaps
Assembly: TheSadRogue.Primitives.dll
Syntax
public sealed class AutoSyncSpatialMap<T> : AutoSyncAdvancedSpatialMap<T>, ISpatialMap<T>, IReadOnlySpatialMap<T>, IEnumerable<ItemPositionPair<T>>, IEnumerable where T : class, IHasID, IPositionable
Type Parameters
Name Description
T

The type of object that will be contained by this spatial map.

Remarks

This class automatically keeps the spatial map position of each object synced up with their Position property; you may either use the Move functions of the spatial map, in which case the Position fields of the objects are updated as appropriate, or you may change the Position field, in which case the spatial map position is updated to match.

If you want to manually control the positions of items in the spatial map, you should use SpatialMap<T> instead.

Constructors

AutoSyncSpatialMap(IEqualityComparer<Point>, Int32)

Constructor.

Declaration
public AutoSyncSpatialMap(IEqualityComparer<Point> pointComparer = null, int initialCapacity = 32)
Parameters
Type Name Description
IEqualityComparer<Point> pointComparer

Equality comparer to use for comparison and hashing of points, as object are added to/removed from/moved around the spatial map. Be especially mindful of the efficiency of its GetHashCode function, as it will determine the efficiency of many SpatialMap functions. Defaults to the default equality comparer for Point.

Int32 initialCapacity

The initial maximum number of elements the SpatialMap can hold before it has to internally resize data structures. Defaults to 32.

Implements

ISpatialMap<T>
IReadOnlySpatialMap<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>, EventHandler<ValueChangedEventArgs<TProperty>>)
In This Article
Back to top Generated by DocFX