Show / Hide Table of Contents

Interface IReadOnlyLayeredSpatialMap<T>

Interface implementing only the read-only functions for LayeredSpatialMap<T>/ AdvancedLayeredSpatialMap<T>.

Inherited Members
IReadOnlySpatialMap<T>.ItemAdded
IReadOnlySpatialMap<T>.ItemMoved
IReadOnlySpatialMap<T>.ItemRemoved
IReadOnlySpatialMap<T>.Count
IReadOnlySpatialMap<T>.Items
IReadOnlySpatialMap<T>.Positions
IReadOnlySpatialMap<T>.Contains(T)
IReadOnlySpatialMap<T>.Contains(Coord)
IReadOnlySpatialMap<T>.Contains(Int32, Int32)
IReadOnlySpatialMap<T>.GetItems(Coord)
IReadOnlySpatialMap<T>.GetItems(Int32, Int32)
IReadOnlySpatialMap<T>.GetPosition(T)
IReadOnlySpatialMap<T>.ToString(Func<T, String>)
System.Collections.Generic.IEnumerable<GoRogue.ISpatialTuple<T>>.GetEnumerator()
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public interface IReadOnlyLayeredSpatialMap<T> : IReadOnlySpatialMap<T>, IEnumerable<ISpatialTuple<T>>, IEnumerable where T : IHasLayer
Type Parameters
Name Description
T

Type of element stored in the layered spatial map -- must implement IHasLayer.

Properties

| Improve this Doc View Source

LayerMasker

Object used to get layer masks as they pertain to this spatial map.

Declaration
LayerMasker LayerMasker { get; }
Property Value
Type Description
LayerMasker
| Improve this Doc View Source

Layers

Gets read-only spatial maps representing each layer. To access a specific layer, instead use GetLayer(Int32).

Declaration
IEnumerable<IReadOnlySpatialMap<T>> Layers { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<IReadOnlySpatialMap<T>>
| Improve this Doc View Source

NumberOfLayers

Gets the number of layers contained in the spatial map.

Declaration
int NumberOfLayers { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

StartingLayer

Starting index for layers contained in this spatial map.

Declaration
int StartingLayer { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

AsReadOnly()

Returns a read-only reference to the spatial map. Convenient for "safely" exposing the spatial map as a property.

Declaration
IReadOnlyLayeredSpatialMap<T> AsReadOnly()
Returns
Type Description
IReadOnlyLayeredSpatialMap<T>

The current spatial map, as a "read-only" reference.

| Improve this Doc View Source

Contains(Coord, UInt32)

Returns whether or not there is an item in the spatial map at the given position that is on a layer included in the given layer mask. Defaults to searching on all layers.

Declaration
bool Contains(Coord position, uint layerMask = 4294967295U)
Parameters
Type Name Description
Coord position

The position to check for.

System.UInt32 layerMask

Layer mask that indicates which layers to check. Defaults to all layers.

Returns
Type Description
System.Boolean

True if there is some item at the given position on a layer included in the given layer mask, false if not.

| Improve this Doc View Source

Contains(Int32, Int32, UInt32)

Returns whether or not there is an item in the data structure at the given position, that is on a layer included in the given layer mask.

Declaration
bool Contains(int x, int y, uint layerMask = 4294967295U)
Parameters
Type Name Description
System.Int32 x

X-value of the position to check for.

System.Int32 y

Y-value of the position to check for.

System.UInt32 layerMask

Layer mask that indicates which layers to check. Defaults to all layers.

Returns
Type Description
System.Boolean

True if there is some item at the given position on a layer included in the given layer mask, false if not.

| Improve this Doc View Source

GetItems(Coord, UInt32)

Gets the item(s) associated with the given position that reside on any layer included in the given layer mask. Returns nothing if there is nothing at that position on a layer included in the given layer mask.

Declaration
IEnumerable<T> GetItems(Coord position, uint layerMask = 4294967295U)
Parameters
Type Name Description
Coord position

The position to return the item(s) for.

System.UInt32 layerMask

Layer mask that indicates which layers to check. Defaults to all layers.

Returns
Type Description
System.Collections.Generic.IEnumerable<T>

The item(s) at the given position that reside on a layer included in the layer mask if there are any items, or nothing if there is nothing at that position.

| Improve this Doc View Source

GetItems(Int32, Int32, UInt32)

Gets the item(s) associated with the given position that reside on any layer included in the given layer mask. Returns nothing if there is nothing at that position on a layer included in the given layer mask.

Declaration
IEnumerable<T> GetItems(int x, int y, uint layerMask = 4294967295U)
Parameters
Type Name Description
System.Int32 x

X-value of the position to return the item(s) for.

System.Int32 y

Y-value of the position to return the item(s) for.

System.UInt32 layerMask

Layer mask that indicates which layers to check. Defaults to all layers.

Returns
Type Description
System.Collections.Generic.IEnumerable<T>

The item(s) at the given position that reside on a layer included in the layer mask if there are any items, or nothing if there is nothing at that position.

| Improve this Doc View Source

GetLayer(Int32)

Gets a read-only spatial map representing the layer specified.

Declaration
IReadOnlySpatialMap<T> GetLayer(int layer)
Parameters
Type Name Description
System.Int32 layer

The layer to retrieve.

Returns
Type Description
IReadOnlySpatialMap<T>

The IReadOnlySpatialMap that represents the given layer.

| Improve this Doc View Source

GetLayers(UInt32)

Returns read-only spatial maps that represent each layer included in the given layer mask. Defaults to all layers.

Declaration
IEnumerable<IReadOnlySpatialMap<T>> GetLayers(uint layerMask = 4294967295U)
Parameters
Type Name Description
System.UInt32 layerMask

Layer mask indicating which layers to return. Defaults to all layers.

Returns
Type Description
System.Collections.Generic.IEnumerable<IReadOnlySpatialMap<T>>

Read-only spatial maps representing each layer in the given layer mask.

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