Interface IReadOnlyLayeredSpatialMap<T>
Interface implementing only the read-only functions for LayeredSpatialMap<T>/ AdvancedLayeredSpatialMap<T>.
Inherited Members
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 SourceLayerMasker
Object used to get layer masks as they pertain to this spatial map.
Declaration
LayerMasker LayerMasker { get; }
Property Value
Type | Description |
---|---|
LayerMasker |
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>> |
NumberOfLayers
Gets the number of layers contained in the spatial map.
Declaration
int NumberOfLayers { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
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 SourceAsReadOnly()
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. |
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. |
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. |
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. |
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. |
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. |
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. |