update to node site

This commit is contained in:
2026-04-15 05:02:45 +10:00
parent 3c45406f6f
commit 7e7e6f2c22
710 changed files with 10532 additions and 8324 deletions

View File

@@ -0,0 +1,50 @@
/**
* @file NodeRegistry.js
* Static registry mapping node type strings to their handler instances.
*/
import { NodeBase } from './NodeBase.js';
/**
* Static registry for all Blueprint node types.
* Node classes self-register by calling UCLASS_Register during module init.
*/
export class NodeRegistry {
/** @type {Map<string, NodeBase>} */
static #registry = new Map();
/**
* Registers a node class by its static NodeType.
* Call once per class, typically at the bottom of the class file.
*
* @UFUNCTION(BlueprintCallable)
* @param {typeof NodeBase} NodeClass
*/
static UCLASS_Register(NodeClass) {
if (!NodeClass.NodeType) {
throw new Error(`[NodeRegistry] "${NodeClass.name}" is missing a static NodeType.`);
}
this.#registry.set(NodeClass.NodeType, new NodeClass());
}
/**
* Returns the handler instance for a given node type, or null.
*
* @UFUNCTION(BlueprintPure)
* @param {string} nodeType
* @returns {NodeBase | null}
*/
static BlueprintPure_Get(nodeType) {
return this.#registry.get(nodeType) ?? null;
}
/**
* Returns all currently registered type strings.
*
* @UFUNCTION(BlueprintPure)
* @returns {string[]}
*/
static BlueprintPure_GetRegisteredTypes() {
return [...this.#registry.keys()];
}
}