refactor: replace number health with Health value object in MagicalObject

- MagicalObject: internal #health and #maxHealth now Health type
- HealingObject: constructor, create, and heal use Health value object
- MagicalWeapon: constructor, create, and use use Health value object
- DamageDealer and Healer interfaces: health: number -> health: Health
- magical-objects.spec.ts: all assertions use .health.value
- Run npm run checks: 0 errors, 70 tests passing
This commit is contained in:
2026-06-14 13:35:44 +01:00
parent 0540e5ff5b
commit ba0903714c
13 changed files with 51679 additions and 11982 deletions
+1 -3
View File
@@ -4,9 +4,7 @@ import { join, parse } from 'node:path';
const VALUE_OBJECTS_DIR = join(import.meta.dirname, '..', 'src', 'value-objects');
function discoverValueObjects() {
const files = readdirSync(VALUE_OBJECTS_DIR).filter(
(f) => f.endsWith('.ts') && f !== 'index.ts',
);
const files = readdirSync(VALUE_OBJECTS_DIR).filter((f) => f.endsWith('.ts') && f !== 'index.ts');
return files.map((f) => parse(f).name);
}