Class RouteSegments
A route segment defining spawn intervals.
Namespace: Holoride.ElasticSDK
Assembly: Holoride.ElasticSDK.Library.Runtime.dll
Syntax
[Serializable]
public class RouteSegments
Properties
Bounds
Declaration
public Interval Bounds { get; }
Property Value
| Type | Description |
|---|---|
| Interval |
Count
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Empty
Gets an empty collection of route segments.
Declaration
public static RouteSegments Empty { get; }
Property Value
| Type | Description |
|---|---|
| RouteSegments |
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[int]
Declaration
public Interval this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| Interval |
Whole
Gets a collection containing the interval [0,1].
Declaration
public static RouteSegments Whole { get; }
Property Value
| Type | Description |
|---|---|
| RouteSegments |
Methods
Add(Interval)
Declaration
public void Add(Interval interval)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | interval |
AddSegment(double, double)
Adds an interval.
Declaration
public void AddSegment(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The start of the interval within the boundaries 0.0 and 1.0. |
| double | max | The end of the interval within the boundaries 0.0 and 1.0. |
Clear()
Declaration
public void Clear()
Contains(Interval)
Declaration
public bool Contains(Interval item)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | item |
Returns
| Type | Description |
|---|---|
| bool |
Contains(double, double)
Tests whether the route contains the given segment.
Declaration
public bool Contains(double min, double max)
Parameters
| Type | Name | Description |
|---|---|---|
| double | min | The start of the interval within the boundaries 0.0 and 1.0. |
| double | max | The end of the interval within the boundaries 0.0 and 1.0. |
Returns
| Type | Description |
|---|---|
| bool | Whether the route contains the given segment. |
Contains(double)
Checks if a given double value is within an interval.
Declaration
public bool Contains(double x)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | The value to check for. |
Returns
| Type | Description |
|---|---|
| bool | Whether the interval contains the given value. |
CopyTo(Interval[], int)
Declaration
public void CopyTo(Interval[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval[] | array | |
| int | arrayIndex |
ForEachInterval(Action<double, double>)
Applies a given action for each segment in a route.
Declaration
public void ForEachInterval(Action<double, double> action)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<double, double> | action | The action that should get applied to each interval. |
GetEnumerator()
Declaration
public IEnumerator<Interval> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<Interval> |
Intersect(RouteSegments, RouteSegments)
Creates the intersection of the segments of the specified route segment collections. Only parts that belong to both collections, will be in the intersection.
Declaration
public static RouteSegments Intersect(RouteSegments a, RouteSegments b)
Parameters
| Type | Name | Description |
|---|---|---|
| RouteSegments | a | The first route segment collection. |
| RouteSegments | b | The second route segment collection. |
Returns
| Type | Description |
|---|---|
| RouteSegments | The RouteSegments containing all intersections. |
Overlaps(Interval)
Checks if the interval is intersecting with at least one segment of the route.
Declaration
public bool Overlaps(Interval interval)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | interval | An interval. |
Returns
| Type | Description |
|---|---|
| bool | Whether the interval is intersecting with at least one interval of route segment collection. |
Overlaps(RouteSegments)
Checks if the segments of a route are intersecting with these segments of a route.
Declaration
public bool Overlaps(RouteSegments other)
Parameters
| Type | Name | Description |
|---|---|---|
| RouteSegments | other | The second collection of route segments. |
Returns
| Type | Description |
|---|---|
| bool | Whether the segments of a route are intersecting with the segments of the other route. |
Remove(Interval)
Declaration
public bool Remove(Interval item)
Parameters
| Type | Name | Description |
|---|---|---|
| Interval | item |
Returns
| Type | Description |
|---|---|
| bool |
UnionWith(RouteSegments)
Creates the union of the segments in this collection and the specified collection by adding all the segments of the specified collection to this one.
Declaration
public void UnionWith(RouteSegments other)
Parameters
| Type | Name | Description |
|---|---|---|
| RouteSegments | other | The other route segment collection. |