@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
62 lines • 1.94 kB
JavaScript
;
/**
* Turret - Child entity class for defensive turret systems
* Turrets are child entities that attach to buildings/units for defense
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnitTurret = exports.BuildingTurret = exports.Turret = void 0;
const child_js_1 = require("./child.cjs");
/**
* Turret class for defensive systems that attach to entities
* Extends Child since turrets are child entities, not abilities
*/
class Turret extends child_js_1.Child {
get type() {
return "turret";
}
constructor(props = {}) {
super();
this.description = "";
this.unlocked = true;
// Turret-specific properties
this.subtype = "turret"; // e.g., "building-turret", "unit-turret"
Object.assign(this, props);
}
/** JSON.stringify() calls this automatically */
toJSON() {
return {
...super.toJSON(),
name: this.name,
description: this.description,
unlocked: this.unlocked,
subtype: this.subtype,
hexiteCost: this.hexiteCost,
fluxCost: this.fluxCost,
buildTime: this.buildTime,
hp: this.hp,
unlocks: this.unlocks,
// Internal game engine data NOT exported - accessed directly from TypeScript instances
// (internalId, internalPath, internalTags, internalSecondaryTags)
};
}
}
exports.Turret = Turret;
/**
* Building Turret - Specialized turret for building defense
*/
class BuildingTurret extends Turret {
constructor(props = {}) {
super(props);
}
}
exports.BuildingTurret = BuildingTurret;
/**
* Unit Turret - Specialized turret for unit add-ons (like Dreadnought modules)
*/
class UnitTurret extends Turret {
constructor(props = {}) {
super(props);
}
}
exports.UnitTurret = UnitTurret;
//# sourceMappingURL=turret.js.map