SpatialElement

class SpatialElement(val modelElement: ModelElement, initLocation: LocationIfc = modelElement.spatialModel.defaultLocation, aName: String? = null, val observableComponent: ObservableComponent<SpatialElementIfc> = ObservableComponent()) : ObservableIfc<SpatialElementIfc> , SpatialElementIfc

Creates a spatial element associated with the spatial model at the location. A spatial element is something associated with a spatial model that has a location.

Constructors

Link copied to clipboard
constructor(modelElement: ModelElement, initLocation: LocationIfc = modelElement.spatialModel.defaultLocation, aName: String? = null, observableComponent: ObservableComponent<SpatialElementIfc> = ObservableComponent())

Properties

Link copied to clipboard
open override var currentLocation: LocationIfc
Link copied to clipboard
open override var initialLocation: LocationIfc
Link copied to clipboard
open override var isMoving: Boolean
Link copied to clipboard
open override var isTracked: Boolean
Link copied to clipboard
open override val modelElement: ModelElement
Link copied to clipboard
Link copied to clipboard
open override var previousLocation: LocationIfc
Link copied to clipboard
open override val spatialID: Int
Link copied to clipboard
open override val spatialModel: SpatialModel
Link copied to clipboard
open override val spatialName: String
Link copied to clipboard
open override var status: SpatialModel.Status

Functions

Link copied to clipboard
open override fun attachObserver(observer: ObserverIfc<SpatialElementIfc>)

Allows the adding (attaching) of an observer to the observable

Link copied to clipboard
open override fun countObservers(): Int

Returns how many observers are currently attached to the observable

Link copied to clipboard
open override fun detachAllObservers()

Detaches all the observers from the observable

Link copied to clipboard
open override fun detachObserver(observer: ObserverIfc<SpatialElementIfc>)

Allows the deletion (removing) of an observer from the observable

Link copied to clipboard
open fun distanceTo(location: LocationIfc): Double
open fun distanceTo(element: SpatialElementIfc): Double
Link copied to clipboard
open override fun initializeSpatialElement()
Link copied to clipboard
open override fun isAttached(observer: ObserverIfc<SpatialElementIfc>): Boolean

Returns true if the observer is already attached

Link copied to clipboard