diff --git a/src/character-creation.spec.ts b/src/character-creation.spec.ts index bb1c118..765be64 100644 --- a/src/character-creation.spec.ts +++ b/src/character-creation.spec.ts @@ -1,6 +1,6 @@ import fc from 'fast-check'; import { describe, it } from 'vitest'; -import { Character } from './Character.ts'; +import { Character } from './characters/Character.ts'; import { Level } from './value-objects/Level.ts'; describe('CharacterCreation', () => { diff --git a/src/Character.ts b/src/characters/Character.ts similarity index 93% rename from src/Character.ts rename to src/characters/Character.ts index b7c81a2..f814531 100644 --- a/src/Character.ts +++ b/src/characters/Character.ts @@ -4,14 +4,14 @@ * "I can't believe it's not Haskell": invariants at boundaries. * State is encapsulated in a CharacterState record type. */ -import { Health } from './value-objects/Health.ts'; -import { Level } from './value-objects/Level.ts'; -import type { Status } from './value-objects/Status.ts'; -import { StatusAlive, StatusDead } from './value-objects/Status.ts'; -import type { CharacterState } from './characters/CharacterState.ts'; -import type { Faction } from './factions/Faction.ts'; -import type { DamageDealer } from './magical-objects/magical-object-types.ts'; -import type { Healer } from './magical-objects/magical-object-types.ts'; +import { Health } from '../value-objects/Health.ts'; +import { Level } from '../value-objects/Level.ts'; +import type { Status } from '../value-objects/Status.ts'; +import { StatusAlive, StatusDead } from '../value-objects/Status.ts'; +import type { CharacterState } from './CharacterState.ts'; +import type { Faction } from '../factions/Faction.ts'; +import type { DamageDealer } from '../magical-objects/magical-object-types.ts'; +import type { Healer } from '../magical-objects/magical-object-types.ts'; export interface CharacterCtor { name: string; diff --git a/src/damage-and-health.spec.ts b/src/damage-and-health.spec.ts index 8210d3f..b86c6c5 100644 --- a/src/damage-and-health.spec.ts +++ b/src/damage-and-health.spec.ts @@ -1,6 +1,6 @@ import fc from 'fast-check'; import { describe, it } from 'vitest'; -import { Character } from './Character.ts'; +import { Character } from './characters/Character.ts'; import { Level } from './value-objects/Level.ts'; describe('DamageAndHealth', () => { diff --git a/src/factions.spec.ts b/src/factions.spec.ts index 0085bf0..aa0c669 100644 --- a/src/factions.spec.ts +++ b/src/factions.spec.ts @@ -1,6 +1,6 @@ import fc from 'fast-check'; import { describe, it } from 'vitest'; -import { Character } from './Character.ts'; +import { Character } from './characters/Character.ts'; import { Faction } from './factions/Faction.ts'; import { Level } from './value-objects/Level.ts'; diff --git a/src/healing.spec.ts b/src/healing.spec.ts index 9761a77..360aada 100644 --- a/src/healing.spec.ts +++ b/src/healing.spec.ts @@ -1,6 +1,6 @@ import fc from 'fast-check'; import { describe, it } from 'vitest'; -import { Character } from './Character.ts'; +import { Character } from './characters/Character.ts'; import { Level } from './value-objects/Level.ts'; describe('Healing', () => { diff --git a/src/levels.spec.ts b/src/levels.spec.ts index ded8b0f..d4c5dc9 100644 --- a/src/levels.spec.ts +++ b/src/levels.spec.ts @@ -1,6 +1,6 @@ import fc from 'fast-check'; import { describe, it } from 'vitest'; -import { Character } from './Character.ts'; +import { Character } from './characters/Character.ts'; import { Level } from './value-objects/Level.ts'; describe('Levels', () => { diff --git a/src/magical-objects.spec.ts b/src/magical-objects.spec.ts index 02dd90b..0186c49 100644 --- a/src/magical-objects.spec.ts +++ b/src/magical-objects.spec.ts @@ -1,9 +1,9 @@ import fc from 'fast-check'; import { describe, it } from 'vitest'; -import { Character } from './Character.ts'; +import { Character } from './characters/Character.ts'; import { Level } from './value-objects/Level.ts'; -import { MagicalWeapon } from './MagicalWeapon.ts'; -import { HealingObject } from './HealingObject.ts'; +import { MagicalWeapon } from './magical-objects/MagicalWeapon.ts'; +import { HealingObject } from './magical-objects/HealingObject.ts'; describe('Magical Objects', () => { describe('WeaponDealsDamage', () => { diff --git a/src/HealingObject.ts b/src/magical-objects/HealingObject.ts similarity index 93% rename from src/HealingObject.ts rename to src/magical-objects/HealingObject.ts index 4567326..1eccb80 100644 --- a/src/HealingObject.ts +++ b/src/magical-objects/HealingObject.ts @@ -6,10 +6,10 @@ * - CurrentHealth never exceeds maxHealth */ -import { Character } from './Character.ts'; -import { Level } from './value-objects/Level.ts'; +import { Character } from '../characters/Character.ts'; +import { Level } from '../value-objects/Level.ts'; import { MagicalObject } from './MagicalObject.ts'; -import type { Healer } from './magical-objects/magical-object-types.ts'; +import type { Healer } from './magical-object-types.ts'; export class HealingObject extends MagicalObject implements Healer { private constructor( diff --git a/src/MagicalObject.ts b/src/magical-objects/MagicalObject.ts similarity index 100% rename from src/MagicalObject.ts rename to src/magical-objects/MagicalObject.ts diff --git a/src/MagicalWeapon.ts b/src/magical-objects/MagicalWeapon.ts similarity index 94% rename from src/MagicalWeapon.ts rename to src/magical-objects/MagicalWeapon.ts index db87244..8b76dde 100644 --- a/src/MagicalWeapon.ts +++ b/src/magical-objects/MagicalWeapon.ts @@ -5,9 +5,9 @@ * Invariants enforced at construction: * - Damage is non-negative */ -import { Character } from './Character.ts'; +import { Character } from '../characters/Character.ts'; import { MagicalObject } from './MagicalObject.ts'; -import type { DamageDealer } from './magical-objects/magical-object-types.ts'; +import type { DamageDealer } from './magical-object-types.ts'; export class MagicalWeapon extends MagicalObject implements DamageDealer { readonly #damage: number; diff --git a/src/magical-objects/magical-object-types.ts b/src/magical-objects/magical-object-types.ts index e41e01f..a83a94f 100644 --- a/src/magical-objects/magical-object-types.ts +++ b/src/magical-objects/magical-object-types.ts @@ -5,8 +5,8 @@ * These interfaces describe magical objects from Character's point of view, * so Character can depend on abstractions rather than concrete classes. */ -import type { Character } from '../Character.ts'; -import type { MagicalObjectStatus } from '../MagicalObject.ts'; +import type { Character } from '../characters/Character.ts'; +import type { MagicalObjectStatus } from './MagicalObject.ts'; /** A magical object that deals damage — from Character's point of view */ export interface DamageDealer {