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

godot.global.GDPrint.kt Maven / Gradle / Ivy

There is a newer version: 0.11.0-4.3
Show newest version
package godot.global

import godot.core.memory.TransferContext
import godot.core.VariantType


internal interface GDPrint {

    /** Converts one or more arguments to strings in the best way possible and prints them to the console.**/
    fun print(vararg args: Any?) {
        TransferContext.writeArguments(VariantType.STRING to args.joinToString(""))
        Bridge.print()
    }

    /** Converts one or more arguments to strings in the best way possible and prints them as error to the console.**/
    fun printErr(vararg args: Any?) {
        TransferContext.writeArguments(VariantType.STRING to args.joinToString(""))
        Bridge.printErr()
    }

    /** Prints the args without any modifications to the console.**/
    fun printRaw(vararg args: Any?) {
        TransferContext.writeArguments(VariantType.STRING to args.joinToString(""))
        Bridge.printRaw()
    }

    /** Prints one or more arguments to the console with a space between each argument.**/
    fun prints(vararg args: Any?) = print(args.joinToString(" "))

    /** Converts one or more arguments to strings in the best way possible and prints them to the console.**/
    fun printt(vararg args: Any?) = print(args.joinToString("\t"))

    fun printStack() = print(Thread.currentThread().stackTrace.joinToString("\n"))

    private object Bridge {
        external fun print()
        external fun printErr()
        external fun printRaw()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy