Show / Hide Table of Contents

Class SettableViewport<T>

Similar to Viewport<T>, but implements ISettableGridView<T>and thus implements "set" functionality via relative coordinates.

Inheritance
Object
GridViewBase<T>
Viewport<T>
SettableViewport<T>
Implements
ISettableGridView<T>
IGridView<T>
Inherited Members
Viewport<T>.SetViewArea(Rectangle)
Viewport<T>.ToString()
Viewport<T>.ToString(Func<T, String>)
Viewport<T>.ToString(Int32, Func<T, String>)
Viewport<T>.ViewArea
Viewport<T>.Height
Viewport<T>.Width
GridViewBase<T>.Count
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.

Implements

ISettableGridView<T>
IGridView<T>

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>, EventHandler<ValueChangedEventArgs<TProperty>>)
In This Article
Back to top Generated by DocFX