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.
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 SourceItem[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. |
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.
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. |