36 lines
803 B
JavaScript
36 lines
803 B
JavaScript
import { SlimeGun } from './skills/WaterGun.js'; // File still named WaterGun.js but class is SlimeGun
|
|
import { FireBreath } from './skills/FireBreath.js';
|
|
import { Pounce } from './skills/Pounce.js';
|
|
import { StealthMode } from './skills/StealthMode.js';
|
|
|
|
/**
|
|
* Registry for all skills in the game
|
|
*/
|
|
export class SkillRegistry {
|
|
static skills = new Map();
|
|
|
|
static {
|
|
// Register all skills
|
|
this.register(new SlimeGun());
|
|
this.register(new FireBreath());
|
|
this.register(new Pounce());
|
|
this.register(new StealthMode());
|
|
}
|
|
|
|
static register(skill) {
|
|
this.skills.set(skill.id, skill);
|
|
}
|
|
|
|
static get(id) {
|
|
return this.skills.get(id);
|
|
}
|
|
|
|
static getAll() {
|
|
return Array.from(this.skills.values());
|
|
}
|
|
|
|
static has(id) {
|
|
return this.skills.has(id);
|
|
}
|
|
}
|
|
|