Class SettableViewport<T>
Similar to Viewport<T>, but implements ISettableMapView<T>and thus implements "set" functionality via relative coordinates.
Inherited Members
Namespace: GoRogue.MapViews
Assembly: GoRogue.dll
Syntax
public class SettableViewport<T> : Viewport<T>, ISettableMapView<T>, IMapView<T>
Type Parameters
Name | Description |
---|---|
T | Type being exposed by map view. |
Constructors
| Improve this Doc View SourceSettableViewport(ISettableMapView<T>)
Constructor. Takes the map view to represent. The viewport will represent the entire given map view.
Declaration
public SettableViewport(ISettableMapView<T> mapView)
Parameters
Type | Name | Description |
---|---|---|
ISettableMapView<T> | mapView | The map view to represent. |
SettableViewport(ISettableMapView<T>, Rectangle)
Constructor. Takes the parent map view, and the initial subsection of that map view to represent.
Declaration
public SettableViewport(ISettableMapView<T> mapView, Rectangle viewArea)
Parameters
Type | Name | Description |
---|---|---|
ISettableMapView<T> | mapView | The map view being represented. |
Rectangle | viewArea | The initial subsection of that map to represent. |
Properties
| Improve this Doc View SourceItem[Coord]
Given a position in relative coordinates, sets/returns the "value" associated with that location in absolute coordinates.
Declaration
public T this[Coord relativePosition] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Coord | 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 |
---|---|---|
System.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 |
---|---|---|
System.Int32 | relativeX | Viewport-relative X-value of location. |
System.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. |
MapView
The map view that this viewport is exposing values from.
Declaration
public ISettableMapView<T> MapView { get; }
Property Value
Type | Description |
---|---|
ISettableMapView<T> |