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

godot.entrygenerator.model.Clazz.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0-4.3.0
Show newest version
package godot.entrygenerator.model

import godot.entrygenerator.ext.hasAnnotation
import godot.tools.common.constants.GodotKotlinJvmTypes
import godot.tools.common.constants.godotApiPackage

open class Clazz(
    open val fqName: String,
    open val relativeSourcePath: String,
    open val supertypes: List = emptyList(),
    open val annotations: List = emptyList(),
    open val isAbstract: Boolean = false,
    override val symbolProcessorSource: Any
) : GodotJvmSourceElement {
    val name: String
        get() = fqName.substringAfterLast(".")
    val containingPackage: String
        get() = if (fqName.contains(".")) {
            fqName.substringBeforeLast(".")
        } else ""

    internal val directlyInheritsGodotBaseClass: Boolean
        get() = supertypes
            .firstOrNull()
            ?.annotations
            ?.hasAnnotation() == true

    internal val inheritsRefCounted: Boolean
        get() = supertypes.any { it.fqName == "$godotApiPackage.${GodotKotlinJvmTypes.refCounted}" }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy