@zerospacegg/iolin
Version:
Pure TypeScript implementation of ZeroSpace game data processing (PKL-free)
56 lines • 1.69 kB
JavaScript
/**
* Turret - Child entity class for defensive turret systems
* Turrets are child entities that attach to buildings/units for defense
*/
import { Child } from "./child.js";
/**
* Turret class for defensive systems that attach to entities
* Extends Child since turrets are child entities, not abilities
*/
export class Turret extends 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)
};
}
}
/**
* Building Turret - Specialized turret for building defense
*/
export class BuildingTurret extends Turret {
constructor(props = {}) {
super(props);
}
}
/**
* Unit Turret - Specialized turret for unit add-ons (like Dreadnought modules)
*/
export class UnitTurret extends Turret {
constructor(props = {}) {
super(props);
}
}
//# sourceMappingURL=turret.js.map