UNPKG

@zerospacegg/iolin

Version:

Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)

37 lines 1.42 kB
"use strict"; /** * Universal - Minimal base class for all game objects * Provides core identity properties that both entities and children need */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Universal = void 0; class Universal { constructor() { // Unlock system properties - every entity can participate in unlock relationships this.unlocked = true; // Whether this entity is currently unlocked (default unlocked) this.unlockedBy = []; // What entities this unlocks (what this enables) } /** Runtime class name hierarchy for frontend dynamic imports */ get className() { const hierarchy = []; let currentConstructor = this.constructor; // Walk up the prototype chain until we hit Universal while (currentConstructor) { hierarchy.push(currentConstructor.name); if (currentConstructor.name === "Universal") break; currentConstructor = Object.getPrototypeOf(currentConstructor); } return hierarchy; } /** First class name for backward compatibility */ get firstClassName() { return this.constructor.name; } /** Canonical URL path for this entity on zerospace.gg */ get zsggPath() { return `https://zerospace.gg/library/${this.id}/`; } } exports.Universal = Universal; //# sourceMappingURL=universal.js.map