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.
Inherited Members
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 SourceFOVBooleanToDoubleTranslationView(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 SourceHeight
The height of the grid being represented.
Declaration
public override int Height { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
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
Width
The width of the grid being represented.
Declaration
public override int Width { get; }
Property Value
Type | Description |
---|---|
int |