Interface ISettableGridView<T>
Interface designed to act as a standardized input/output format that defines minimal required data for algorithms that operate and make changes to a grid of some sort. For a concrete implementation to subclass for custom implementations, see SettableGridViewBase<T>.
Namespace: SadRogue.Primitives.GridViews
Assembly: TheSadRogue.Primitives.dll
Syntax
public interface ISettableGridView<T> : IGridView<T>
Type Parameters
Name | Description |
---|---|
T | The type of value being returned/set by the indexer functions. |
Remarks
See IGridView<T>. This interface serves the same purpose, but for cases when it is also necessary for an algorithm to be able to change the value at each location.
Like IGridView, a number of implementations of this interface to cover common needs are provided. For example, ArrayView<T> defines the interface such that the data is retrieved from and set to an array, and LambdaSettableGridView<T> defines the interface such that arbitrary callbacks are used to retrieve and set the data.
Properties
| Improve this Doc View SourceItem[Point]
Given a position, returns/sets the "value" associated with that location.
Declaration
T this[Point pos] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Point | 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 |
---|---|---|
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[Point] by using FromIndex(Int32, Int32) to calculate the 2D position represented by that 1D index, and passing that position to the Item[Point] 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 |
---|---|---|
Int32 | x | X-value of location. |
Int32 | y | Y-value of location. |
Property Value
Type | Description |
---|---|
T | The "value" associated with that location. |
Remarks
Typically, this can be implemented via Item[Point].