| 1234567891011121314151617181920212223242526272829 |
- import { Castor } from './Castor';
- import type { Character, CharacterStats } from './Character';
- import { Generic } from './Generic';
- import { Mamie } from './Mamie';
- import { Pyromanchot } from './Pyromanchot';
- // Menu order: the three M5 characters, then the test character.
- const registry: Record<string, new (stats: CharacterStats) => Character> = {
- castor: Castor,
- mamie: Mamie,
- pyromanchot: Pyromanchot,
- generic: Generic,
- };
- /** Ids of playable characters, in menu order. */
- export const CHARACTER_IDS = Object.keys(registry);
- export function isCharacterId(id: string): boolean {
- return Object.hasOwn(registry, id);
- }
- export function createCharacter(stats: CharacterStats): Character {
- const ctor = registry[stats.id];
- if (!ctor) throw new Error(`Unknown character "${stats.id}"`);
- return new ctor(stats);
- }
- export { Anim, Character, parseCharacterStats } from './Character';
- export type { Blast, CharacterContext, CharacterStats, ProjectileSpec } from './Character';
|