Show / Hide Table of Contents

Class FOVBooleanToDoubleTranslationView

Implements a grid view which, given an IReadOnlyFOV instance, can calculate the value for DoubleResultView based on BooleanResultView. The double returned will be 0 if the square is outside the FOV, and will be a value in the range (0, 1] which is a function of the distance from the appropriate source otherwise.

Inheritance
object
GridViewBase<double>
FOVBooleanToDoubleTranslationView
Implements
IGridView<double>
Inherited Members
GridViewBase<double>.Count
GridViewBase<double>.this[int, int]
GridViewBase<double>.this[int]
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: GoRogue.FOV
Assembly: GoRogue.dll
Syntax
public class FOVBooleanToDoubleTranslationView : GridViewBase<double>, IGridView<double>
Remarks

This is useful to use as the DoubleResultView property of an FOV, if the FOV algorithm really only deals in boolean values and the doubles returned are purely a function of the calculation's radius/distance. FOV implementations using this method of determining the DoubleResultView values from the BooleanResultView values can typically use less memory than algorithms dealing directly in doubles; but accessing values from DoubleResultView will be slower, especially when multiple CalculateAppend calls are used before values are retrieved.

Constructors

View Source

FOVBooleanToDoubleTranslationView(IReadOnlyFOV)

Constructor.

Declaration
public FOVBooleanToDoubleTranslationView(IReadOnlyFOV parent)
Parameters
Type Name Description
IReadOnlyFOV parent

The IReadOnlyFOV instance for which this grid view is producing double values.

Properties

View Source

Height

The height of the grid being represented.

Declaration
public override int Height { get; }
Property Value
Type Description
int
Overrides
SadRogue.Primitives.GridViews.GridViewBase<double>.Height
View Source

this[Point]

Given a position, returns the "value" associated with that location.

Declaration
public override double this[Point pos] { get; }
Parameters
Type Name Description
Point pos

Location to retrieve the value for.

Property Value
Type Description
double

The "value" associated with the provided location.

Overrides
SadRogue.Primitives.GridViews.GridViewBase<double>.this[SadRogue.Primitives.Point]
View Source

Width

The width of the grid being represented.

Declaration
public override int Width { get; }
Property Value
Type Description
int
Overrides
SadRogue.Primitives.GridViews.GridViewBase<double>.Width

Implements

IGridView<T>

Extension Methods

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