All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codetome.zircon.api.behavior.Boundable.kt Maven / Gradle / Ivy

Go to download

Zircon is a terminal emulator which targets multiple GUI platforms and designed specifically for game developers.

The newest version!
package org.codetome.zircon.api.behavior

import org.codetome.zircon.api.Position
import org.codetome.zircon.api.Size

/**
 * Represents an object which has bounds in 2d space. A [Boundable] object can provide useful information
 * about its geometry relating to other [Boundable]s (like intersection).
 */
interface Boundable : Positionable {

    /**
     * Returns the [Size] of this [Boundable].
     */
    fun getBoundableSize(): Size

    /**
     * Tells whether this [Boundable] intersects the other boundable or not.
     */
    fun intersects(boundable: Boundable): Boolean

    /**
     * Tells whether `position` is within this boundable's bounds.
     */
    fun containsPosition(position: Position): Boolean

    /**
     * Tells whether this boundable contains the other `boundable`.
     * A [Boundable] contains another if the other boundable's bounds
     * are within this one's. (If their bounds are the same it is considered
     * a containment).
     */
    fun containsBoundable(boundable: Boundable): Boolean
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy