Show / Hide Table of Contents

Class LayeredSpatialMap<T>

ISpatialMap<T> implementation that can be used to efficiently represent multiple "layers" of objects, with each layer represented as an ISpatialMap<T> instance. It provides the regular spatial map functionality, as well as adds layer masking functionality that allow functions to operate on specific layers only.

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

Type of items stored in the layers. Type T must implement IHasID and IHasLayer, must be a reference type, and its Layer value MUST NOT change while the item is in the spatial map.

Remarks

See the ISpatialMap<T> for documentation on the practical purpose of spatial maps.

The objects stored in a LayeredSpatialMap must be reference types and implement both IHasID and IHasLayer. Each object in a spatial map is presumed to have a "layer", which is assumed to remain constant once the item is added to the layer mask.

Constructors

| Improve this Doc View Source

LayeredSpatialMap(Int32, Int32, UInt32)

Constructor.

Declaration
public LayeredSpatialMap(int numberOfLayers, int startingLayer = 0, uint layersSupportingMultipleItems = 0U)
Parameters
Type Name Description
System.Int32 numberOfLayers

Number of layers to include.

System.Int32 startingLayer

Index to use for the first layer.

System.UInt32 layersSupportingMultipleItems

A layer mask indicating which layers should support multiple items residing at the same location on that layer. Defaults to no layers. Generate this layer mask via DEFAULT.

Remarks

This class allows you to specify the starting index for layers in order to make it easy to combine with other structures in a map which may represent other layers. For example, if a startingLayer of 0 is specified, layers in the spatial map will have numbers in range[0, numberOfLayers - 1]. If 1 is specified, layers will have numbers in range [1-numberOfLayers], and anything to do with layer 0 will be ignored. For example, If a layer-mask that includes layers 0, 2, and 3 is passed to a function, only layers 2 and 3 are considered (since they are the only ones that would be included in the spatial map.

Implements

ISpatialMap<T>
IReadOnlyLayeredSpatialMap<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