Class SenseSource
Represents a source location to be used in a SenseMap.
Inheritance
Inherited Members
Namespace: GoRogue.SenseMapping
Assembly: GoRogue.dll
Syntax
public class SenseSource
Remarks
Typically, you create these, and then call AddSenseSource(SenseSource) to add them to a sensory map, and perhaps retain a reference for the sake of moving it around or toggling it on-off. Note that changing values such as Position and Radius after the source is created is possible, however changes will not be reflected in any SenseMap instances using this source until their next call to Calculate().
Constructors
| Improve this Doc View SourceSenseSource(SourceType, Coord, Double, Distance, Double)
Constructor.
Declaration
public SenseSource(SourceType type, Coord position, double radius, Distance distanceCalc, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
SourceType | type | The spread mechanics to use for source values. |
Coord | position | The position on a map that the source is located at. |
System.Double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
System.Double | intensity | The starting intensity value of the source. Defaults to 1.0. |
SenseSource(SourceType, Coord, Double, Distance, Double, Double, Double)
Constructor. Creates a source whose spreading is restricted to a certain angle and span.
Declaration
public SenseSource(SourceType type, Coord position, double radius, Distance distanceCalc, double angle, double span, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
SourceType | type | The spread mechanics to use for source values. |
Coord | position | The position on a map that the source is located at. |
System.Double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
System.Double | angle | The angle in degrees that specifies the outermost center point of the cone formed by the source's values. 0 degrees points right. |
System.Double | span | The angle, in degrees, that specifies the full arc contained in the cone formed by the source's values --
|
System.Double | intensity | The starting intensity value of the source. Defaults to 1.0. |
SenseSource(SourceType, Int32, Int32, Double, Distance, Double)
Constructor.
Declaration
public SenseSource(SourceType type, int positionX, int positionY, double radius, Distance distanceCalc, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
SourceType | type | The spread mechanics to use for source values. |
System.Int32 | positionX | The X-value of the position on a map that the source is located at. |
System.Int32 | positionY | The Y-value of the position on a map that the source is located at. |
System.Double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
System.Double | intensity | The starting intensity value of the source. Defaults to 1.0. |
SenseSource(SourceType, Int32, Int32, Double, Distance, Double, Double, Double)
Constructor. Creates a source whose spread is restricted to a certain angle and span.
Declaration
public SenseSource(SourceType type, int positionX, int positionY, double radius, Distance distanceCalc, double angle, double span, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
SourceType | type | The spread mechanics to use for source values. |
System.Int32 | positionX | The x-value for the position on a map that the source is located at. |
System.Int32 | positionY | The y-value for the position on a map that the source is located at. |
System.Double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
System.Double | angle | The angle in degrees that specifies the outermost center point of the cone formed by the source's values. 0 degrees points right. |
System.Double | span | The angle, in degrees, that specifies the full arc contained in the cone formed by the source's values --
|
System.Double | intensity | The starting intensity value of the source. Defaults to 1.0. |
Properties
| Improve this Doc View SourceAngle
If IsAngleRestricted is true, the angle in degrees that represents a line from the source's start to the outermost center point of the cone formed by the source's calculated values. 0 degrees points right. Otherwise, this will be 0.0 degrees.
Declaration
public double Angle { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
DistanceCalc
The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius).
Declaration
public Distance DistanceCalc { get; set; }
Property Value
Type | Description |
---|---|
Distance |
Enabled
Whether or not this source is enabled. If a source is disabled when Calculate() is called, the source does not calculate values and is effectively assumed to be "off".
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Intensity
The starting value of the source to spread. Defaults to 1.0.
Declaration
public double Intensity { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
IsAngleRestricted
Whether or not the spreading of values from this source is restricted to an angle and span.
Declaration
public bool IsAngleRestricted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Position
The position on a map that the source is located at.
Declaration
public Coord Position { get; }
Property Value
Type | Description |
---|---|
Coord |
Radius
The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. Changing this will trigger resizing (re-allocation) of the underlying arrays.
Declaration
public double Radius { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Span
If IsAngleRestricted is true, the angle in degrees that represents the full arc of the cone formed by the source's calculated values. Otherwise, it will be 360 degrees.
Declaration
public double Span { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Type
The spread mechanics to use for source values.
Declaration
public SourceType Type { get; set; }
Property Value
Type | Description |
---|---|
SourceType |
Methods
| Improve this Doc View SourceToString()
Returns a string representation of the configuration of this SenseSource.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of the configuration of this SenseSource. |