Show / Hide Table of Contents

Interface ISettableMapView<T>

Interface designed to act as a standardized input/output interpretation for algorithms that need to make modifications to data on a map.

Inherited Members
IMapView<T>.Height
IMapView<T>.Width
Namespace: GoRogue.MapViews
Assembly: GoRogue.dll
Syntax
public interface ISettableMapView<T> : IMapView<T>
Type Parameters
Name Description
T

The type of value being returned/set by the indexer functions.

Remarks

See IMapView<T>. Algorithms such as map generation may need to modify their inputs. Again, creating an actual 2D array can be tedious, depending on the application. As such, this interface extends IMapView to provide the capability to "set" values

Like IMapView, a number of implementations of this interface to cover common cases are provided. For example, in case an actual array is desired, ArrayMap<T> implements this interface for you via an actual array. Similarly, LambdaSettableMapView<T> implements the interface for you via a function you pass to it.

Properties

| Improve this Doc View Source

Item[Coord]

Given a position, returns/sets the "value" associated with that location.

Declaration
T this[Coord pos] { get; set; }
Parameters
Type Name Description
Coord pos

Location to get/set the value for.

Property Value
Type Description
T

The "value" associated with the provided location.

| Improve this Doc View Source

Item[Int32]

Given an 1-dimensional index, returns/sets the value associated with the corresponding position in the map view.

Declaration
T this[int index1D] { get; set; }
Parameters
Type Name Description
System.Int32 index1D

1D index of location to get/set the "value" for.

Property Value
Type Description
T

The "value" associated with the given location.

Remarks

Typically, this may be implemented in terms of Item[Coord] by using ToCoord(Int32, Int32) to calculate the 2D position represented by that 1D index, and passing that position to the Item[Coord] indexer to get/set the value associated with the position.

| Improve this Doc View Source

Item[Int32, Int32]

Given an X and Y value, returns/sets the "value" associated with that location.

Declaration
T this[int x, int y] { get; set; }
Parameters
Type Name Description
System.Int32 x

X-value of location.

System.Int32 y

Y-value of location.

Property Value
Type Description
T

The "value" associated with that location.

Extension Methods

Utility.Yield<T>(T)
IMapViewExtensions.ApplyOverlay<T>(ISettableMapView<T>, IMapView<T>)
IMapViewExtensions.Bounds<T>(IMapView<T>)
IMapViewExtensions.Contains<T>(IMapView<T>, Int32, Int32)
IMapViewExtensions.Contains<T>(IMapView<T>, Coord)
IMapViewExtensions.ExtendToString<T>(IMapView<T>, String, String, Func<T, String>, String, String, String, String)
IMapViewExtensions.ExtendToString<T>(IMapView<T>, Int32, String, String, Func<T, String>, String, String, String, String)
IMapViewExtensions.Positions<T>(IMapView<T>)
IMapViewExtensions.RandomItem<T>(IMapView<T>, IGenerator)
IMapViewExtensions.RandomItem<T>(IMapView<T>, Func<Coord, T, Boolean>, IGenerator)
IMapViewExtensions.RandomPosition<T>(IMapView<T>, T, IGenerator)
IMapViewExtensions.RandomPosition<T>(IMapView<T>, IEnumerable<T>, IGenerator)
IMapViewExtensions.RandomPosition<T>(IMapView<T>, HashSet<T>, IGenerator)
IMapViewExtensions.RandomPosition<T>(IMapView<T>, IGenerator, T[])
IMapViewExtensions.RandomPosition<T>(IMapView<T>, Func<Coord, T, Boolean>, IGenerator)
IMapViewExtensions.RandomPosition<T>(IMapView<T>, IGenerator)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX