Show / Hide Table of Contents

Class SettableGridViewBase<T>

A convenient base class to inherit from when implementing ISettableGridView<T> that minimizes the number of items you must implement by implementing indexers in terms of a single indexer taking a Point.

Inheritance
object
SettableGridViewBase<T>
ArrayView2D<T>
DiffAwareGridView<T>
LambdaSettableGridView<T>
SettableTranslationGridView<T1, T2>
Implements
ISettableGridView<T>
IGridView<T>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadRogue.Primitives.GridViews
Assembly: TheSadRogue.Primitives.dll
Syntax
public abstract class SettableGridViewBase<T> : ISettableGridView<T>, IGridView<T>
Type Parameters
Name Description
T

Constructors

View Source

SettableGridViewBase()

Declaration
protected SettableGridViewBase()

Properties

View Source

Count

Number of tiles in the grid; equal to Width * Height.

Declaration
public int Count { get; }
Property Value
Type Description
int
View Source

Height

The height of the grid being represented.

Declaration
public abstract int Height { get; }
Property Value
Type Description
int
View Source

this[Point]

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

Declaration
public abstract T this[Point pos] { get; set; }
Parameters
Type Name Description
Point pos
Property Value
Type Description
T
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.

View Source

this[int]

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

Declaration
public T this[int index1D] { get; set; }
Parameters
Type Name Description
int index1D
Property Value
Type Description
T
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.

View Source

this[int, int]

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

Declaration
public T this[int x, int y] { get; set; }
Parameters
Type Name Description
int x
int y
Property Value
Type Description
T
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.

View Source

Width

The width of the grid being represented.

Declaration
public abstract int Width { get; }
Property Value
Type Description
int

Methods

View Source

Clear()

Sets every location within the grid view to the default value for the type.

Declaration
public virtual void Clear()
Remarks

This function can sometimes be implemented more efficiently than Fill(default), so it is provided as an interface function to enable dispatching.

Remember the default value of a non-nullable type is null for reference types; so use with caution if your element type is non-nullable!

View Source

Fill(T)

Sets every location within the grid view to the given value.

Declaration
public virtual void Fill(T value)
Parameters
Type Name Description
T value

Value to set to all locations in the grid view.

Implements

ISettableGridView<T>
IGridView<T>

Extension Methods

GridViewExtensions.Bounds<T>(IGridView<T>)
GridViewExtensions.Contains<T>(IGridView<T>, Point)
GridViewExtensions.Contains<T>(IGridView<T>, int, int)
GridViewExtensions.ExtendToString<T>(IGridView<T>, int, string, string, Func<T, string>?, string, string, string, string)
GridViewExtensions.ExtendToString<T>(IGridView<T>, string, string, Func<T, string>?, string, string, string, string)
GridViewExtensions.Positions<T>(IGridView<T>)
GridViewExtensions.ApplyOverlay<T>(ISettableGridView<T>, IGridView<T>)
GridViewExtensions.ApplyOverlay<T>(ISettableGridView<T>, Func<Point, T>)
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>>?)
  • View Source
In this article
Back to top Generated by DocFX