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

com.almasb.fxgl.entity.components.CollidableComponent.kt Maven / Gradle / Ivy

/*
 * FXGL - JavaFX Game Library. The MIT License (MIT).
 * Copyright (c) AlmasB ([email protected]).
 * See LICENSE for details.
 */

package com.almasb.fxgl.entity.components

import java.io.Serializable
import java.util.*

/**
 * Marks an entity as collidable.
 *
 * @author Almas Baimagambetov (AlmasB) ([email protected])
 */
class CollidableComponent(collidable: Boolean) : BooleanComponent(collidable) {

    private val ignoredTypes = ArrayList()

    fun getIgnoredTypes(): List {
        return ignoredTypes
    }

    fun addIgnoredType(type: Serializable) {
        ignoredTypes.add(type)
    }

    fun removeIgnoredType(type: Serializable) {
        ignoredTypes.remove(type)
    }

    override fun isComponentInjectionRequired(): Boolean = false
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy