Levels

sealed class Levels

Represents the level(s) an entity is located on: outdoor, a single level, or a range of levels.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

An error raised while creating Levels from an invalid array of level values.

Link copied to clipboard
object Outdoor : Levels

The entity is outdoor, not associated with any level.

Link copied to clipboard
data class Range(val range: ClosedRange<Float>) : Levels

The entity spans a range of levels.

Link copied to clipboard
data class Single(val level: Float) : Levels

The entity is on a single level.

Properties

Link copied to clipboard

Returns true if the value is Outdoor.

Link copied to clipboard

Returns true if the value is Range.

Link copied to clipboard

Returns true if the value is Single.

Link copied to clipboard

The single level value: the level for Single, the lower bound for Range, null for Outdoor.

Functions

Link copied to clipboard
fun contains(other: Levels): Boolean

Returns true if a level is contained in another level.

Link copied to clipboard
fun diff(other: Levels): Float?

Returns the level difference between the current level and another level.

Link copied to clipboard

Returns the level of intersection between the current level and another level.

Link copied to clipboard

Returns true if a level intersects another one.

Link copied to clipboard
fun toList(): List<Float>

Returns the level(s) as a list: empty for Outdoor, one value for Single, two bounds for Range.

Link copied to clipboard
fun union(other: Levels): Levels

Returns the union of the current level and another level.