Class DoubleBasedFOVBase
Base class which is convenient for defining FOV algorithms which produce an array of doubles as output, and thus they derive their BooleanResultView values from the double values (anything greater than 0 is true).
Inherited Members
Namespace: GoRogue.FOV
Assembly: GoRogue.dll
Syntax
public abstract class DoubleBasedFOVBase : FOVBase, IFOV, IReadOnlyFOV
Remarks
This class inherits from FOVBase, and all the caveats mentioned in its remarks section should apply. If you instead want to define an FOV algorithm as returning boolean values, and deriving doubles from that, you can use BooleanBasedFOVBase instead. If neither of those use cases fits your situation, feel free to use FOVBase or IFOV directly.
Although it can vary by implementation, if all other things are equal, classes that use this implementation as opposed to BooleanBasedFOVBase generally tend to take up more memory, however they will generally be able to retrieve values from DoubleResultView more quickly. Retrieving values from BooleanResultView can be slightly slower than from DoubleResultView, since the boolean values are derived from the double values.
Constructors
View SourceDoubleBasedFOVBase(IGridView<bool>, ISettableGridView<double>)
Constructor.
Declaration
protected DoubleBasedFOVBase(IGridView<bool> transparencyView, ISettableGridView<double> resultView)
Parameters
Type | Name | Description |
---|---|---|
IGridView<bool> | transparencyView | The values used to calculate field of view. Values of true are considered non-blocking (transparent) to line of sight, while false values are considered to be blocking. |
ISettableGridView<double> | resultView | The view in which FOV calculations are stored. |
Fields
View SourceResultView
View in which the results of LOS calculations are stored. The values in this view are used to derive the public result views.
Declaration
protected ISettableGridView<double> ResultView
Field Value
Type | Description |
---|---|
ISettableGridView<double> |
Remarks
The requirements for these values are identical to DoubleResultView. DoubleResultView simply exposes these values directly; BooleanResultView considers any location where ResultView > 0 to be true.
Properties
View SourceBooleanResultView
A view of the calculation results in boolean form, where true indicates a location is in field of view, and false indicates it is not.
Declaration
public override IGridView<bool> BooleanResultView { get; }
Property Value
Type | Description |
---|---|
IGridView<bool> |
Overrides
View SourceDoubleResultView
A view of the calculation results in double form, where a value greater than 0.0 indicates that the value is inside of FOV, and a value of 1.0 indicates the center point. All other values vary between 0.0 and 1.0, decreasing as positions get farther away from the center point.
Declaration
public override IGridView<double> DoubleResultView { get; }
Property Value
Type | Description |
---|---|
IGridView<double> |