Class SettableViewport<T>
Similar to Viewport<T>, but implements ISettableGridView<T>and thus implements "set" functionality via relative coordinates.
Inherited Members
Namespace: SadRogue.Primitives.GridViews
Assembly: TheSadRogue.Primitives.dll
Syntax
public class SettableViewport<T> : Viewport<T>, ISettableGridView<T>, IGridView<T>
Type Parameters
Name | Description |
---|---|
T | Type being exposed by map view. |
Constructors
SettableViewport(ISettableGridView<T>)
Constructor. Takes the map view to represent. The viewport will represent the entire given map view.
Declaration
public SettableViewport(ISettableGridView<T> gridView)
Parameters
Type | Name | Description |
---|---|---|
ISettableGridView<T> | gridView | The map view to represent. |
SettableViewport(ISettableGridView<T>, Rectangle)
Constructor. Takes the parent map view, and the initial subsection of that map view to represent.
Declaration
public SettableViewport(ISettableGridView<T> gridView, Rectangle viewArea)
Parameters
Type | Name | Description |
---|---|---|
ISettableGridView<T> | gridView | The map view being represented. |
Rectangle | viewArea | The initial subsection of that map to represent. |
Properties
GridView
The map view that this viewport is exposing values from.
Declaration
public ISettableGridView<T> GridView { get; }
Property Value
Type | Description |
---|---|
ISettableGridView<T> |
Item[Point]
Given a position in relative coordinates, sets/returns the "value" associated with that location in absolute coordinates.
Declaration
public T this[Point relativePosition] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Point | relativePosition | Viewport-relative position of the location to retrieve/set the value for. |
Property Value
Type | Description |
---|---|
T | The "value" associated with the absolute location represented on the underlying map view. |
Item[Int32]
Given a position in relative 1d-array-index style, returns/sets the "value" associated with that location in absolute coordinates.
Declaration
public T this[int relativeIndex1D] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | relativeIndex1D | Viewport-relative position of the location to retrieve/set the value for, as a 1D array index. |
Property Value
Type | Description |
---|---|
T | The "value" associated with the absolute location represented on the underlying map view. |
Item[Int32, Int32]
Given an X and Y value in relative coordinates, sets/returns the "value" associated with that location in absolute coordinates.
Declaration
public T this[int relativeX, int relativeY] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | relativeX | Viewport-relative X-value of location. |
Int32 | relativeY | Viewport-relative Y-value of location. |
Property Value
Type | Description |
---|---|
T | The "value" associated with the absolute location represented on the underlying map view. |