Skip to content

Instantly share code, notes, and snippets.

View RpxdYTX's full-sized avatar
💭

Rafael RpxdYTX

💭
View GitHub Profile
@RpxdYTX
RpxdYTX / generic_type.gd
Last active January 12, 2026 18:16
Godot 4 Compile Time* Generics
class_name GenericType extends Node
## A class helper to create custom generic types through a template script
##
## Example: [codeblock]
## # prevent instances without specified types with @asbtract (very important else code might crash)
## @abstract class_name Foo extends RefCounted
##
## const T := GenericType.Param
## static func with(type): GenericType.register(Foo, { T = type })
##