Show / Hide Table of Contents

Class MultiSpatialMap<T>

An implementation of ISpatialMap<T> that allows multiple items to reside at any given position at the same time. If you wish to allow only one item to reside at each location at a time, use SpatialMap<T> instead. For a situation involving different categories or layers of items, you may want to look at LayeredSpatialMap<T>.

Inheritance
System.Object
AdvancedMultiSpatialMap<T>
MultiSpatialMap<T>
Implements
ISpatialMap<T>
IReadOnlySpatialMap<T>
System.Collections.Generic.IEnumerable<ISpatialTuple<T>>
System.Collections.IEnumerable
Inherited Members
AdvancedMultiSpatialMap<T>.ItemAdded
AdvancedMultiSpatialMap<T>.ItemMoved
AdvancedMultiSpatialMap<T>.ItemRemoved
AdvancedMultiSpatialMap<T>.Count
AdvancedMultiSpatialMap<T>.Items
AdvancedMultiSpatialMap<T>.Positions
AdvancedMultiSpatialMap<T>.Add(T, Coord)
AdvancedMultiSpatialMap<T>.Add(T, Int32, Int32)
AdvancedMultiSpatialMap<T>.AsReadOnly()
AdvancedMultiSpatialMap<T>.Clear()
AdvancedMultiSpatialMap<T>.Contains(T)
AdvancedMultiSpatialMap<T>.Contains(Coord)
AdvancedMultiSpatialMap<T>.Contains(Int32, Int32)
AdvancedMultiSpatialMap<T>.GetEnumerator()
AdvancedMultiSpatialMap<T>.IEnumerable.GetEnumerator()
AdvancedMultiSpatialMap<T>.GetItems(Coord)
AdvancedMultiSpatialMap<T>.GetItems(Int32, Int32)
AdvancedMultiSpatialMap<T>.GetPosition(T)
AdvancedMultiSpatialMap<T>.Move(T, Coord)
AdvancedMultiSpatialMap<T>.Move(T, Int32, Int32)
AdvancedMultiSpatialMap<T>.Move(Coord, Coord)
AdvancedMultiSpatialMap<T>.Move(Int32, Int32, Int32, Int32)
AdvancedMultiSpatialMap<T>.Remove(T)
AdvancedMultiSpatialMap<T>.Remove(Coord)
AdvancedMultiSpatialMap<T>.Remove(Int32, Int32)
AdvancedMultiSpatialMap<T>.ToString(Func<T, String>)
AdvancedMultiSpatialMap<T>.ToString()
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 MultiSpatialMap<T> : AdvancedMultiSpatialMap<T>, ISpatialMap<T>, IReadOnlySpatialMap<T>, IEnumerable<ISpatialTuple<T>>, IEnumerable where T : class, IHasID
Type Parameters
Name Description
T

The type of items being stored in the spatial map. 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 MultiSpatialMap must implement IHasID. This is used internally to keep track of the objects, since uints are easily (and efficiently) hashable.

Although MultiSpatialMap is generally quite performant, if you know the spatial map will only have one item at any given position at a time, SpatialMap<T> may yield better performance.

Constructors

| Improve this Doc View Source

MultiSpatialMap(Int32)

Constructor.

Declaration
public MultiSpatialMap(int initialCapacity = 32)
Parameters
Type Name Description
System.Int32 initialCapacity

The initial maximum number of elements the spatial map 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

Utility.ExtendToString<T>(IEnumerable<T>, String, Func<T, String>, String, String)
Utility.Yield<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX