Class SpatialMap<T>
An implementation of ISpatialMap<T> that allows only one item at each position at a time. If you need multiple items to be able to reside at one location at the same time, use MultiSpatialMap<T> or LayeredSpatialMap<T> instead.
Implements
ISpatialMap<T>
System.Collections.Generic.IEnumerable<ISpatialTuple<T>>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public class SpatialMap<T> : AdvancedSpatialMap<T>, ISpatialMap<T>, IReadOnlySpatialMap<T>, IEnumerable<ISpatialTuple<T>>, IEnumerable where T : class, IHasID
Type Parameters
Name | Description |
---|---|
T | The type of object that will be contained by this SpatialMap. Must implement IHasID and be a reference-type. |
Remarks
See the ISpatialMap<T> for documentation on the practical purpose of spatial maps.
The objects stored in a SpatialMap must implement IHasID. This is used internally to keep track of the objects, since uints are easily (and efficiently) hashable.
Constructors
| Improve this Doc View SourceSpatialMap(Int32)
Constructor.
Declaration
public SpatialMap(int initialCapacity = 32)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | initialCapacity | The initial maximum number of elements the SpatialMap can hold before it has to internally resize data structures. Defaults to 32. |
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable