Show / Hide Table of Contents

Struct CustomResultViewWithResize

A structure containing a grid view and a custom resize function to use in order to resize that grid view to a new size.

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: GoRogue.SenseMapping
Assembly: GoRogue.dll
Syntax
public readonly struct CustomResultViewWithResize
Remarks

Resizer takes in the new width/height required and the old grid view; and must return a new grid view of the appropriate size. It can return a new object or an existing one; the result in either case will be assigned to the result view of the sense map when the resize takes place. The resize function must also ensure that, when the new grid view is returned, it must have all values set to 0.0. This allows a clear operation to be avoided if underlying data structures were re-allocated and thus cells are implicitly cleared.

This structure also provides a ArrayViewResizer(int, int, ISettableGridView<double>), which is an efficient resizer to use if the ResultView is an ArrayView.

Constructors

View Source

CustomResultViewWithResize(ISettableGridView<double>, Func<int, int, ISettableGridView<double>, ISettableGridView<double>>)

Constructor.

Declaration
public CustomResultViewWithResize(ISettableGridView<double> resultView, Func<int, int, ISettableGridView<double>, ISettableGridView<double>> resizer)
Parameters
Type Name Description
ISettableGridView<double> resultView

Result view to initially use.

Func<int, int, ISettableGridView<double>, ISettableGridView<double>> resizer

Resizer function which must clear, resize, and return the result view.

Fields

View Source

Resizer

The resizer function to use. See the CustomResultViewWithResize class description for constraints on this function.

Declaration
public readonly Func<int, int, ISettableGridView<double>, ISettableGridView<double>> Resizer
Field Value
Type Description
Func<int, int, ISettableGridView<double>, ISettableGridView<double>>
View Source

ResultView

The initial result view to use.

Declaration
public readonly ISettableGridView<double> ResultView
Field Value
Type Description
ISettableGridView<double>

Methods

View Source

ArrayViewResizer(int, int, ISettableGridView<double>)

An array resize function appropriate for use as a Resizer when the grid view being used is an ArrayView.

Declaration
public static ISettableGridView<double> ArrayViewResizer(int width, int height, ISettableGridView<double> currentView)
Parameters
Type Name Description
int width
int height
ISettableGridView<double> currentView
Returns
Type Description
ISettableGridView<double>

An array view re-allocated/cleared as appropriate.

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX