diff --git a/src/renderer/game/core/clock.ts b/src/renderer/game/engine/kernel/clock.ts similarity index 97% rename from src/renderer/game/core/clock.ts rename to src/renderer/game/engine/kernel/clock.ts index 2028157..b27c8ad 100644 --- a/src/renderer/game/core/clock.ts +++ b/src/renderer/game/engine/kernel/clock.ts @@ -1,4 +1,4 @@ -import type { World } from '../engine/world' +import type { World } from '../runtime/World' /** * 统一时轮调度:所有系统以 phase 注册,由时钟按固定顺序驱动。 diff --git a/src/renderer/game/core/format.ts b/src/renderer/game/engine/kernel/format.ts similarity index 100% rename from src/renderer/game/core/format.ts rename to src/renderer/game/engine/kernel/format.ts diff --git a/src/renderer/game/core/fxqueue.ts b/src/renderer/game/engine/kernel/fxqueue.ts similarity index 100% rename from src/renderer/game/core/fxqueue.ts rename to src/renderer/game/engine/kernel/fxqueue.ts diff --git a/src/renderer/game/core/guide.ts b/src/renderer/game/engine/kernel/guide.ts similarity index 96% rename from src/renderer/game/core/guide.ts rename to src/renderer/game/engine/kernel/guide.ts index ee46400..59012b1 100644 --- a/src/renderer/game/core/guide.ts +++ b/src/renderer/game/engine/kernel/guide.ts @@ -1,4 +1,4 @@ -import type { World } from '../engine/world' +import type { World } from '../runtime/World' export interface GuideStep { id: string diff --git a/src/renderer/game/core/names.ts b/src/renderer/game/engine/kernel/names.ts similarity index 100% rename from src/renderer/game/core/names.ts rename to src/renderer/game/engine/kernel/names.ts diff --git a/src/renderer/game/core/plugin.ts b/src/renderer/game/engine/kernel/plugin.ts similarity index 91% rename from src/renderer/game/core/plugin.ts rename to src/renderer/game/engine/kernel/plugin.ts index 60b2124..9ac296d 100644 --- a/src/renderer/game/core/plugin.ts +++ b/src/renderer/game/engine/kernel/plugin.ts @@ -1,7 +1,7 @@ import { GameClock, SystemHook } from './clock' -import { DataPack } from '../data/registry' -import { EventDef } from '../data/events' -import type { World } from '../engine/world' +import { DataPack } from '../../data/registry' +import { EventDef } from '../../data/events' +import type { World } from '../runtime/World' export type PluginKind = 'system' | 'data' | 'events' | 'content' diff --git a/src/renderer/game/core/rng.ts b/src/renderer/game/engine/kernel/rng.ts similarity index 98% rename from src/renderer/game/core/rng.ts rename to src/renderer/game/engine/kernel/rng.ts index c250b70..8f70317 100644 --- a/src/renderer/game/core/rng.ts +++ b/src/renderer/game/engine/kernel/rng.ts @@ -1,4 +1,4 @@ -import type { RngState } from '../types/domain' +import type { RngState } from '../../types/domain' function xmur3(str: string): () => number { let h = 1779033703 ^ str.length diff --git a/src/renderer/game/core/timesense.ts b/src/renderer/game/engine/kernel/timesense.ts similarity index 97% rename from src/renderer/game/core/timesense.ts rename to src/renderer/game/engine/kernel/timesense.ts index a2fcf0a..f015518 100644 --- a/src/renderer/game/core/timesense.ts +++ b/src/renderer/game/engine/kernel/timesense.ts @@ -1,4 +1,4 @@ -import { Season } from '../data/season' +import { Season } from '../../data/season' export const TIDES: string[] = [ '立春', '雨水', '惊蛰', '春分', '清明', '谷雨', diff --git a/src/renderer/game/core/urgency.ts b/src/renderer/game/engine/kernel/urgency.ts similarity index 95% rename from src/renderer/game/core/urgency.ts rename to src/renderer/game/engine/kernel/urgency.ts index fc4d24b..74bfb53 100644 --- a/src/renderer/game/core/urgency.ts +++ b/src/renderer/game/engine/kernel/urgency.ts @@ -1,4 +1,4 @@ -import type { World } from '../engine/world' +import type { World } from '../runtime/World' export interface Urgency { blockedCount: number diff --git a/src/renderer/game/core/biography.ts b/src/renderer/game/engine/narrative/biography.ts similarity index 92% rename from src/renderer/game/core/biography.ts rename to src/renderer/game/engine/narrative/biography.ts index fc707df..8d1514b 100644 --- a/src/renderer/game/core/biography.ts +++ b/src/renderer/game/engine/narrative/biography.ts @@ -1,8 +1,8 @@ -import { GameState } from '../types/domain' -import { TECHNIQUES } from '../data/techniques' -import { describeRealm } from '../data/realms' -import { aspirationById } from '../data/aspirations' -import { postById } from '../data/posts' +import { GameState } from '../../types/domain' +import { TECHNIQUES } from '../../data/techniques' +import { describeRealm } from '../../data/realms' +import { aspirationById } from '../../data/aspirations' +import { postById } from '../../data/posts' export interface BioLine { at?: number diff --git a/src/renderer/game/core/genealogy.ts b/src/renderer/game/engine/narrative/genealogy.ts similarity index 94% rename from src/renderer/game/core/genealogy.ts rename to src/renderer/game/engine/narrative/genealogy.ts index 07087b7..b03f80b 100644 --- a/src/renderer/game/core/genealogy.ts +++ b/src/renderer/game/engine/narrative/genealogy.ts @@ -1,5 +1,5 @@ -import { Character } from '../types/domain' -import type { World } from '../engine/world' +import { Character } from '../../types/domain' +import type { World } from '../runtime/World' export interface FamilyUnit { parents: [Character | undefined, Character | undefined] diff --git a/src/renderer/game/core/legacy.ts b/src/renderer/game/engine/narrative/legacy.ts similarity index 96% rename from src/renderer/game/core/legacy.ts rename to src/renderer/game/engine/narrative/legacy.ts index 48156a8..d83a263 100644 --- a/src/renderer/game/core/legacy.ts +++ b/src/renderer/game/engine/narrative/legacy.ts @@ -1,5 +1,5 @@ -import { GameState } from '../types/domain' -import { MAJOR_ORDER } from '../data/realms' +import { GameState } from '../../types/domain' +import { MAJOR_ORDER } from '../../data/realms' export interface LegacyDims { renXing: number diff --git a/src/renderer/game/core/legacyreport.ts b/src/renderer/game/engine/narrative/legacyreport.ts similarity index 98% rename from src/renderer/game/core/legacyreport.ts rename to src/renderer/game/engine/narrative/legacyreport.ts index a91a278..6bad3f1 100644 --- a/src/renderer/game/core/legacyreport.ts +++ b/src/renderer/game/engine/narrative/legacyreport.ts @@ -1,4 +1,4 @@ -import { GameState } from '../types/domain' +import { GameState } from '../../types/domain' export interface LegacyReport { years: number[] diff --git a/src/renderer/game/core/yearaxis.ts b/src/renderer/game/engine/narrative/yearaxis.ts similarity index 97% rename from src/renderer/game/core/yearaxis.ts rename to src/renderer/game/engine/narrative/yearaxis.ts index 6513913..07bc60e 100644 --- a/src/renderer/game/core/yearaxis.ts +++ b/src/renderer/game/engine/narrative/yearaxis.ts @@ -1,4 +1,4 @@ -import { GameState } from '../types/domain' +import { GameState } from '../../types/domain' export interface AxisEvent { year: number diff --git a/src/renderer/game/engine/api.ts b/src/renderer/game/engine/runtime/ApiFacade.ts similarity index 92% rename from src/renderer/game/engine/api.ts rename to src/renderer/game/engine/runtime/ApiFacade.ts index 357254b..2dda3c7 100644 --- a/src/renderer/game/engine/api.ts +++ b/src/renderer/game/engine/runtime/ApiFacade.ts @@ -1,14 +1,14 @@ -import type { World } from './world' -import { WorldEventBus } from './world' -import { YearlyReport, BattleLog, ChronicleEntry, SaveMeta } from '../types/domain' -import { marketPrice, buyItem, sellItem, buyTechnique } from './market' -import { sendMission, recallAll } from './systems/missions' -import { giftNpc, makePeace, marryNpcFamily } from './systems/diplomacy' -import { combatPowerOf } from './systems/combat' -import type { LogKind } from './world' -import { computeLegacy, resolveLegacy, LegacyArch } from '../core/legacy' -import { yearAxis, AxisCell } from '../core/yearaxis' -import { PACK } from '../data/registry' +import type { World } from './World' +import { WorldEventBus } from './World' +import { YearlyReport, BattleLog, ChronicleEntry, SaveMeta } from '../../types/domain' +import { marketPrice, buyItem, sellItem, buyTechnique } from '../sim/Market' +import { sendMission, recallAll } from './Systems/missions' +import { giftNpc, makePeace, marryNpcFamily } from './Systems/diplomacy' +import { combatPowerOf } from './Systems/combat' +import type { LogKind } from './World' +import { computeLegacy, resolveLegacy, LegacyArch } from '../narrative/legacy' +import { yearAxis, AxisCell } from '../narrative/yearaxis' +import { PACK } from '../../data/registry' export type ActName = | 'head.set' diff --git a/src/renderer/game/engine/systems/combat.ts b/src/renderer/game/engine/runtime/Systems/combat.ts similarity index 93% rename from src/renderer/game/engine/systems/combat.ts rename to src/renderer/game/engine/runtime/Systems/combat.ts index 85bee69..4597da6 100644 --- a/src/renderer/game/engine/systems/combat.ts +++ b/src/renderer/game/engine/runtime/Systems/combat.ts @@ -1,14 +1,14 @@ -import type { World } from '../world' -import { Character, BattleLog } from '../../types/domain' -import { basePower, describeRealm } from '../../data/realms' -import { pack } from '../../data/registry' -import { techniqueById } from '../../data/techniques' -import { EnemyDef, LootDef } from '../../data/secrets' +import type { World } from '../World' +import { Character, BattleLog } from '../../../types/domain' +import { basePower, describeRealm } from '../../../data/realms' +import { pack } from '../../../data/registry' +import { techniqueById } from '../../../data/techniques' +import { EnemyDef, LootDef } from '../../../data/secrets' import { traitBonuses } from '../pcgen' -import { npcById } from '../../data/npcs' -import { aspirationById, fitBonusOf } from '../../data/aspirations' -import { formationById, FormationId } from '../../data/formations' +import { npcById } from '../../../data/npcs' +import { aspirationById, fitBonusOf } from '../../../data/aspirations' +import { formationById, FormationId } from '../../../data/formations' export function combatPowerOf(w: World, c: Character): number { if (!c.alive) return 0 diff --git a/src/renderer/game/engine/systems/cultivation.ts b/src/renderer/game/engine/runtime/Systems/cultivation.ts similarity index 93% rename from src/renderer/game/engine/systems/cultivation.ts rename to src/renderer/game/engine/runtime/Systems/cultivation.ts index a92900b..c3c9393 100644 --- a/src/renderer/game/engine/systems/cultivation.ts +++ b/src/renderer/game/engine/runtime/Systems/cultivation.ts @@ -1,16 +1,16 @@ -import type { World } from '../world' -import { Character } from '../../types/domain' -import { ROOT_GRADES } from '../../data/elements' -import { masteryRateOfMajor } from '../../data/pacing' -import { aspirationById, fitBonusOf } from '../../data/aspirations' -import { techniqueById } from '../../data/techniques' -import { nextRealm, breakthroughBaseChance, realmDeathChance, describeRealm, MAJOR_ORDER } from '../../data/realms' +import type { World } from '../World' +import { Character } from '../../../types/domain' +import { ROOT_GRADES } from '../../../data/elements' +import { masteryRateOfMajor } from '../../../data/pacing' +import { aspirationById, fitBonusOf } from '../../../data/aspirations' +import { techniqueById } from '../../../data/techniques' +import { nextRealm, breakthroughBaseChance, realmDeathChance, describeRealm, MAJOR_ORDER } from '../../../data/realms' import { lifespanOf } from './lifecycle' import { traitBonuses } from '../pcgen' import { newCharacter } from '../pcgen' -import { MALE_GIVEN, FEMALE_GIVEN } from '../../core/names' -import { ASPIRATION_IDS } from '../../data/aspirations' -import { seasonMod } from '../../data/season' +import { MALE_GIVEN, FEMALE_GIVEN } from '../../kernel/names' +import { ASPIRATION_IDS } from '../../../data/aspirations' +import { seasonMod } from '../../../data/season' import { needsTribulation, tribulationEventId } from './tribulation' export function monthlyRate(w: World, c: Character): number { diff --git a/src/renderer/game/engine/systems/diplomacy.ts b/src/renderer/game/engine/runtime/Systems/diplomacy.ts similarity index 97% rename from src/renderer/game/engine/systems/diplomacy.ts rename to src/renderer/game/engine/runtime/Systems/diplomacy.ts index 7cf4eeb..903fe09 100644 --- a/src/renderer/game/engine/systems/diplomacy.ts +++ b/src/renderer/game/engine/runtime/Systems/diplomacy.ts @@ -1,5 +1,5 @@ -import type { World } from '../world' -import { npcById } from '../../data/npcs' +import type { World } from '../World' +import { npcById } from '../../../data/npcs' import { findEvent, fire } from './events' export function diplomacyTick(w: World): void { diff --git a/src/renderer/game/engine/systems/events.ts b/src/renderer/game/engine/runtime/Systems/events.ts similarity index 98% rename from src/renderer/game/engine/systems/events.ts rename to src/renderer/game/engine/runtime/Systems/events.ts index e66738a..4a96f54 100644 --- a/src/renderer/game/engine/systems/events.ts +++ b/src/renderer/game/engine/runtime/Systems/events.ts @@ -1,16 +1,16 @@ -import type { World } from '../world' -import { Character } from '../../types/domain' -import { Cond, EffectDef, EventDef, EVENTS, MemberEffect } from '../../data/events' -import { MAJOR_ORDER } from '../../data/realms' +import type { World } from '../World' +import { Character } from '../../../types/domain' +import { Cond, EffectDef, EventDef, EVENTS, MemberEffect } from '../../../data/events' +import { MAJOR_ORDER } from '../../../data/realms' -import { npcById } from '../../data/npcs' +import { npcById } from '../../../data/npcs' import { resolveRaid } from './combat' import { sendMission } from './missions' -import { pack } from '../../data/registry' +import { pack } from '../../../data/registry' import { findInheritor } from '../creation' import { resolveTribulation } from './tribulation' -import { nextRealm, describeRealm } from '../../data/realms' +import { nextRealm, describeRealm } from '../../../data/realms' const ALL_EVENTS: EventDef[] = [...EVENTS] diff --git a/src/renderer/game/engine/systems/lifecycle.ts b/src/renderer/game/engine/runtime/Systems/lifecycle.ts similarity index 95% rename from src/renderer/game/engine/systems/lifecycle.ts rename to src/renderer/game/engine/runtime/Systems/lifecycle.ts index fc13a5e..4fb49e2 100644 --- a/src/renderer/game/engine/systems/lifecycle.ts +++ b/src/renderer/game/engine/runtime/Systems/lifecycle.ts @@ -1,5 +1,5 @@ -import type { World } from '../world' -import { MAJORS } from '../../data/realms' +import type { World } from '../World' +import { MAJORS } from '../../../data/realms' import { calcLifespan } from '../pcgen' export function lifespanOf(w: World, c: { realm: { major: keyof typeof MAJORS }; physique: number }): number { diff --git a/src/renderer/game/engine/systems/marriage.ts b/src/renderer/game/engine/runtime/Systems/marriage.ts similarity index 95% rename from src/renderer/game/engine/systems/marriage.ts rename to src/renderer/game/engine/runtime/Systems/marriage.ts index df3cdea..5a5b448 100644 --- a/src/renderer/game/engine/systems/marriage.ts +++ b/src/renderer/game/engine/runtime/Systems/marriage.ts @@ -1,9 +1,9 @@ -import type { World } from '../world' -import { Character } from '../../types/domain' +import type { World } from '../World' +import { Character } from '../../../types/domain' import { produceOffspring } from './cultivation' import { yearGrowth } from './diplomacy' -import { MALE_GIVEN, FEMALE_GIVEN } from '../../core/names' -import { aspirationById } from '../../data/aspirations' +import { MALE_GIVEN, FEMALE_GIVEN } from '../../kernel/names' +import { aspirationById } from '../../../data/aspirations' export function yearStartMarriage(w: World): void { yearGrowth(w) diff --git a/src/renderer/game/engine/systems/missions.ts b/src/renderer/game/engine/runtime/Systems/missions.ts similarity index 94% rename from src/renderer/game/engine/systems/missions.ts rename to src/renderer/game/engine/runtime/Systems/missions.ts index f488b8c..04839c6 100644 --- a/src/renderer/game/engine/systems/missions.ts +++ b/src/renderer/game/engine/runtime/Systems/missions.ts @@ -1,10 +1,10 @@ -import type { World } from '../world' -import { MissionState } from '../../types/domain' -import { FormationId } from '../../data/formations' -import { missionById, MissionDef, ENEMIES } from '../../data/secrets' +import type { World } from '../World' +import { MissionState } from '../../../types/domain' +import { FormationId } from '../../../data/formations' +import { missionById, MissionDef, ENEMIES } from '../../../data/secrets' import { resolveEncounter, rollWarbooty } from './combat' -import { techniqueById } from '../../data/techniques' -import { describeRealm } from '../../data/realms' +import { techniqueById } from '../../../data/techniques' +import { describeRealm } from '../../../data/realms' export function missionTick(w: World): void { const active = w.state.missions.filter((m) => !m.done) diff --git a/src/renderer/game/engine/systems/production.ts b/src/renderer/game/engine/runtime/Systems/production.ts similarity index 92% rename from src/renderer/game/engine/systems/production.ts rename to src/renderer/game/engine/runtime/Systems/production.ts index ccd8d42..8f2da55 100644 --- a/src/renderer/game/engine/systems/production.ts +++ b/src/renderer/game/engine/runtime/Systems/production.ts @@ -1,6 +1,6 @@ -import type { World } from '../world' -import { aspirationById } from '../../data/aspirations' -import { seasonMod } from '../../data/season' +import type { World } from '../World' +import { aspirationById } from '../../../data/aspirations' +import { seasonMod } from '../../../data/season' export function productionTick(w: World): void { const fam = w.state.family diff --git a/src/renderer/game/engine/systems/tournament.ts b/src/renderer/game/engine/runtime/Systems/tournament.ts similarity index 96% rename from src/renderer/game/engine/systems/tournament.ts rename to src/renderer/game/engine/runtime/Systems/tournament.ts index 92f8b97..1e6eb5d 100644 --- a/src/renderer/game/engine/systems/tournament.ts +++ b/src/renderer/game/engine/runtime/Systems/tournament.ts @@ -1,10 +1,10 @@ -import type { World } from '../world' -import { Character } from '../../types/domain' -import { ENEMIES, EnemyDef } from '../../data/secrets' +import type { World } from '../World' +import { Character } from '../../../types/domain' +import { ENEMIES, EnemyDef } from '../../../data/secrets' import { resolveEncounter } from './combat' import { rankPower } from './events' import { resolveBreakthrough } from './cultivation' -import { FormationId } from '../../data/formations' +import { FormationId } from '../../../data/formations' export const SECTS = ['云栖宗', '太谷书院', '玄微剑阁', '丹霞洞天'] diff --git a/src/renderer/game/engine/systems/tribulation.ts b/src/renderer/game/engine/runtime/Systems/tribulation.ts similarity index 96% rename from src/renderer/game/engine/systems/tribulation.ts rename to src/renderer/game/engine/runtime/Systems/tribulation.ts index eeedf5b..f3c5718 100644 --- a/src/renderer/game/engine/systems/tribulation.ts +++ b/src/renderer/game/engine/runtime/Systems/tribulation.ts @@ -1,6 +1,6 @@ -import type { World } from '../world' -import { Character } from '../../types/domain' -import { nextRealm, MAJOR_ORDER, realmDeathChance, describeRealm } from '../../data/realms' +import type { World } from '../World' +import { Character } from '../../../types/domain' +import { nextRealm, MAJOR_ORDER, realmDeathChance, describeRealm } from '../../../data/realms' export const TRIB_MAJORS: string[] = ['foundation', 'core', 'nascent', 'spirit'] diff --git a/src/renderer/game/engine/world.ts b/src/renderer/game/engine/runtime/World.ts similarity index 96% rename from src/renderer/game/engine/world.ts rename to src/renderer/game/engine/runtime/World.ts index 0f20d46..d875305 100644 --- a/src/renderer/game/engine/world.ts +++ b/src/renderer/game/engine/runtime/World.ts @@ -7,25 +7,25 @@ import { LogItem, Realm, YearlyReport -} from '../types/domain' -import { Rng } from '../core/rng' -import { BUILDINGS } from '../data/buildings' -import { POSTS } from '../data/posts' -import { aspirationById as aspirationOf } from '../data/aspirations' -import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount, LegacyArch } from '../core/legacy' +} from '../../types/domain' +import { Rng } from '../kernel/rng' +import { BUILDINGS } from '../../data/buildings' +import { POSTS } from '../../data/posts' +import { aspirationById as aspirationOf } from '../../data/aspirations' +import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount, LegacyArch } from '../narrative/legacy' import { createWorldState, findInheritor } from './creation' import { SYSTEM_DEFS, SystemDef } from './capabilities' import { emptyClock } from './clocks' -import { CotycPlugin, PluginContext, PluginStatus } from '../core/plugin' +import { CotycPlugin, PluginContext, PluginStatus } from '../kernel/plugin' import { PluginManager } from './pluginManager' -import { EventDef } from '../data/events' -import { pack, DEFAULT_PACK, PACK } from '../data/registry' +import { EventDef } from '../../data/events' +import { pack, DEFAULT_PACK, PACK } from '../../data/registry' import { CORE_PLUGINS } from './plugin-bootstrap' -import { GameClock } from '../core/clock' -import { SystemHook } from '../core/clock' -import { resolveBreakthrough } from './systems/cultivation' -import { applyEventChoice } from './systems/events' -import { combatPowerOf } from './systems/combat' +import { GameClock } from '../kernel/clock' +import { SystemHook } from '../kernel/clock' +import { resolveBreakthrough } from './Systems/cultivation' +import { applyEventChoice } from './Systems/events' +import { combatPowerOf } from './Systems/combat' export type LogKind = LogItem['kind'] @@ -138,7 +138,7 @@ export class World { } } - private packOverride(partial: Partial): void { + private packOverride(partial: Partial): void { PACK.override(partial) } diff --git a/src/renderer/game/engine/capabilities.ts b/src/renderer/game/engine/runtime/capabilities.ts similarity index 97% rename from src/renderer/game/engine/capabilities.ts rename to src/renderer/game/engine/runtime/capabilities.ts index aa158d0..ef13405 100644 --- a/src/renderer/game/engine/capabilities.ts +++ b/src/renderer/game/engine/runtime/capabilities.ts @@ -1,4 +1,4 @@ -import type { PhaseId } from '../core/clock' +import type { PhaseId } from '../kernel/clock' export interface SystemDef { id: string diff --git a/src/renderer/game/engine/clocks.ts b/src/renderer/game/engine/runtime/clocks.ts similarity index 85% rename from src/renderer/game/engine/clocks.ts rename to src/renderer/game/engine/runtime/clocks.ts index bc0cc98..087d572 100644 --- a/src/renderer/game/engine/clocks.ts +++ b/src/renderer/game/engine/runtime/clocks.ts @@ -1,13 +1,13 @@ -import { GameClock } from '../core/clock' -import { PluginContext } from '../core/plugin' -import type { World } from './world' -import { productionTick } from './systems/production' -import { deathTick, woundHealTick } from './systems/lifecycle' -import { cultivationTick } from './systems/cultivation' -import { missionTick } from './systems/missions' -import { eventRoll } from './systems/events' -import { diplomacyTick } from './systems/diplomacy' -import { yearStartMarriage } from './systems/marriage' +import { GameClock } from '../kernel/clock' +import { PluginContext } from '../kernel/plugin' +import type { World } from './World' +import { productionTick } from './Systems/production' +import { deathTick, woundHealTick } from './Systems/lifecycle' +import { cultivationTick } from './Systems/cultivation' +import { missionTick } from './Systems/missions' +import { eventRoll } from './Systems/events' +import { diplomacyTick } from './Systems/diplomacy' +import { yearStartMarriage } from './Systems/marriage' /** 原语义保留:满门凋零后仅存生产/寿元与收尾 */ function ifAlive(fn: (w: World) => void): (w: World) => void { diff --git a/src/renderer/game/engine/creation.ts b/src/renderer/game/engine/runtime/creation.ts similarity index 96% rename from src/renderer/game/engine/creation.ts rename to src/renderer/game/engine/runtime/creation.ts index 2dee176..5bd5ca8 100644 --- a/src/renderer/game/engine/creation.ts +++ b/src/renderer/game/engine/runtime/creation.ts @@ -1,9 +1,9 @@ -import { Character, GameState, NpcFamilyState, RealmMajor } from '../types/domain' -import { Rng, seedToRng } from '../core/rng' -import { randomSurname, MALE_GIVEN, FEMALE_GIVEN } from '../core/names' +import { Character, GameState, NpcFamilyState, RealmMajor } from '../../types/domain' +import { Rng, seedToRng } from '../kernel/rng' +import { randomSurname, MALE_GIVEN, FEMALE_GIVEN } from '../kernel/names' import { newCharacter } from './pcgen' -import { NPCS } from '../data/npcs' -import { World } from './world' +import { NPCS } from '../../data/npcs' +import { World } from './World' export interface NewGameOptions { seed: string diff --git a/src/renderer/game/engine/demo-plugins.ts b/src/renderer/game/engine/runtime/demo-plugins.ts similarity index 96% rename from src/renderer/game/engine/demo-plugins.ts rename to src/renderer/game/engine/runtime/demo-plugins.ts index 65e52fe..e44c7ba 100644 --- a/src/renderer/game/engine/demo-plugins.ts +++ b/src/renderer/game/engine/runtime/demo-plugins.ts @@ -1,4 +1,4 @@ -import { CotycPlugin } from '../core/plugin' +import { CotycPlugin } from '../kernel/plugin' /** 示例内容插件:注入事件池 + 一个护山能力(开发范本) */ export const examplePlugin: CotycPlugin = { diff --git a/src/renderer/game/engine/pcgen.ts b/src/renderer/game/engine/runtime/pcgen.ts similarity index 94% rename from src/renderer/game/engine/pcgen.ts rename to src/renderer/game/engine/runtime/pcgen.ts index d27b5c9..ff4e1d1 100644 --- a/src/renderer/game/engine/pcgen.ts +++ b/src/renderer/game/engine/runtime/pcgen.ts @@ -1,8 +1,8 @@ -import { Character, Element, Gender, Realm, RealmMajor } from '../types/domain' -import { Rng } from '../core/rng' -import { ELEMENT_LIST, ROOT_GRADES } from '../data/elements' -import { MAJORS } from '../data/realms' -import { TRAIT_POOL, TRAITS } from '../data/traits' +import { Character, Element, Gender, Realm, RealmMajor } from '../../types/domain' +import { Rng } from '../kernel/rng' +import { ELEMENT_LIST, ROOT_GRADES } from '../../data/elements' +import { MAJORS } from '../../data/realms' +import { TRAIT_POOL, TRAITS } from '../../data/traits' export function rollRoots(rng: Rng, parents?: { m?: Character; f?: Character }): { grade: number; primary: Element; secondary: Element[] } { let grade: number diff --git a/src/renderer/game/engine/plugin-bootstrap.ts b/src/renderer/game/engine/runtime/plugin-bootstrap.ts similarity index 91% rename from src/renderer/game/engine/plugin-bootstrap.ts rename to src/renderer/game/engine/runtime/plugin-bootstrap.ts index 922df5c..34323db 100644 --- a/src/renderer/game/engine/plugin-bootstrap.ts +++ b/src/renderer/game/engine/runtime/plugin-bootstrap.ts @@ -1,7 +1,7 @@ -import { CotycPlugin } from '../core/plugin' +import { CotycPlugin } from '../kernel/plugin' import { installCoreSystems } from './clocks' -import { EVENTS } from '../data/events' -import { DEFAULT_PACK } from '../data/registry' +import { EVENTS } from '../../data/events' +import { DEFAULT_PACK } from '../../data/registry' /** 内置插件一:镇族基石(12 能力卡与时轮钩子) */ export function makeCoreSystemsPlugin(): CotycPlugin { diff --git a/src/renderer/game/engine/pluginManager.ts b/src/renderer/game/engine/runtime/pluginManager.ts similarity index 95% rename from src/renderer/game/engine/pluginManager.ts rename to src/renderer/game/engine/runtime/pluginManager.ts index dc9f58c..4fabdce 100644 --- a/src/renderer/game/engine/pluginManager.ts +++ b/src/renderer/game/engine/runtime/pluginManager.ts @@ -1,8 +1,8 @@ -import { CotycPlugin, PluginContext, PluginStatus, PluginChange } from '../core/plugin' -import { SystemDef, SYSTEM_DEFS } from '../engine/capabilities' -import type { World } from '../engine/world' -import { SystemHook } from '../core/clock' -import { GameClock } from '../core/clock' +import { CotycPlugin, PluginContext, PluginStatus, PluginChange } from '../kernel/plugin' +import { SystemDef, SYSTEM_DEFS } from './capabilities' +import type { World } from './World' +import { SystemHook } from '../kernel/clock' +import { GameClock } from '../kernel/clock' interface RuntimePlugin { plugin: CotycPlugin diff --git a/src/renderer/game/engine/market.ts b/src/renderer/game/engine/sim/Market.ts similarity index 90% rename from src/renderer/game/engine/market.ts rename to src/renderer/game/engine/sim/Market.ts index 2099bee..f1d6a53 100644 --- a/src/renderer/game/engine/market.ts +++ b/src/renderer/game/engine/sim/Market.ts @@ -1,6 +1,6 @@ -import type { World } from './world' -import { pack } from '../data/registry' -import { traitBonuses } from './pcgen' +import type { World } from '../runtime/World' +import { pack } from '../../data/registry' +import { traitBonuses } from '../runtime/pcgen' export function marketPrice(w: World, itemId: string): number { const item = pack().items[itemId] @@ -48,7 +48,7 @@ export function techniquePrice(techId: string): number { return TECH_GRADE_BASE[techId] ?? 200 } -import { TECHNIQUES } from '../data/techniques' +import { TECHNIQUES } from '../../data/techniques' const TECHNIQUE_GRADE_PRICE: Record = { 1: 120, 2: 300, 3: 700, 4: 1600 } const TECH_GRADE_BASE: Record = Object.fromEntries( diff --git a/src/renderer/game/storage/migrate.ts b/src/renderer/game/storage/migrate.ts index ac18e13..4ed5daa 100644 --- a/src/renderer/game/storage/migrate.ts +++ b/src/renderer/game/storage/migrate.ts @@ -1,5 +1,5 @@ import { GameState } from '../types/domain' -import { normalizeGameState } from '../engine/world' +import { normalizeGameState } from '../engine/runtime/World' export const CURRENT_SCHEMA = 2 export const APP_ID = 'cotyc' diff --git a/src/renderer/ui/components/EventModal.tsx b/src/renderer/ui/components/EventModal.tsx index 0715fa1..c2c50a1 100644 --- a/src/renderer/ui/components/EventModal.tsx +++ b/src/renderer/ui/components/EventModal.tsx @@ -1,10 +1,10 @@ import { useState } from 'react' import { useGameStore } from '../store' -import { applyEventChoice, rankPower } from '../../game/engine/systems/events' +import { applyEventChoice, rankPower } from '../../game/engine/runtime/Systems/events' import { eventCategoryName } from '../../game/data/events' import { describeRealm } from '../../game/data/realms' import { Character } from '../../game/types/domain' -import { combatPowerOf } from '../../game/engine/systems/combat' +import { combatPowerOf } from '../../game/engine/runtime/Systems/combat' import { FORMATIONS, FormationId } from '../../game/data/formations' import { ModalShell } from './ModalShell' diff --git a/src/renderer/ui/components/GuideStrip.tsx b/src/renderer/ui/components/GuideStrip.tsx index a1b6fff..daae94b 100644 --- a/src/renderer/ui/components/GuideStrip.tsx +++ b/src/renderer/ui/components/GuideStrip.tsx @@ -1,5 +1,5 @@ import { useGameStore } from '../store' -import { GUIDE_STEPS, computeGuide, guideAdvance } from '../../game/core/guide' +import { GUIDE_STEPS, computeGuide, guideAdvance } from '../../game/engine/kernel/guide' export function GuideStrip() { const world = useGameStore((s) => s.world) diff --git a/src/renderer/ui/components/MemberModal.tsx b/src/renderer/ui/components/MemberModal.tsx index 32cc90e..6a444a5 100644 --- a/src/renderer/ui/components/MemberModal.tsx +++ b/src/renderer/ui/components/MemberModal.tsx @@ -5,12 +5,12 @@ import { describeRoots, ROOT_GRADE_NAMES } from '../../game/data/elements' import { TRAITS } from '../../game/data/traits' import { TECHNIQUES } from '../../game/data/techniques' import { ITEMS, ARTIFACT_POWER } from '../../game/data/items' -import { combatPowerOf } from '../../game/engine/systems/combat' -import { lifespanOf } from '../../game/engine/systems/lifecycle' -import { perAttemptChance } from '../../game/engine/systems/cultivation' +import { combatPowerOf } from '../../game/engine/runtime/Systems/combat' +import { lifespanOf } from '../../game/engine/runtime/Systems/lifecycle' +import { perAttemptChance } from '../../game/engine/runtime/Systems/cultivation' import { POSTS, POST_ORDER } from '../../game/data/posts' import { ModalShell } from './ModalShell' -import { buildBiography } from '../../game/core/biography' +import { buildBiography } from '../../game/engine/narrative/biography' function aspName(c: Character): string { const map: Record = { diff --git a/src/renderer/ui/components/ResolveModal.tsx b/src/renderer/ui/components/ResolveModal.tsx index 81129d8..699633d 100644 --- a/src/renderer/ui/components/ResolveModal.tsx +++ b/src/renderer/ui/components/ResolveModal.tsx @@ -1,5 +1,5 @@ import { useGameStore } from '../store' -import { LegacyArch } from '../../game/core/legacy' +import { LegacyArch } from '../../game/engine/narrative/legacy' import { sBell } from '../sound' import { ModalShell } from './ModalShell' diff --git a/src/renderer/ui/components/UrgentBadges.tsx b/src/renderer/ui/components/UrgentBadges.tsx index 20b36fe..f49c5ed 100644 --- a/src/renderer/ui/components/UrgentBadges.tsx +++ b/src/renderer/ui/components/UrgentBadges.tsx @@ -1,5 +1,5 @@ import { useGameStore } from '../store' -import { computeUrgency } from '../../game/core/urgency' +import { computeUrgency } from '../../game/engine/kernel/urgency' export function UrgentBadges() { const world = useGameStore((s) => s.world) diff --git a/src/renderer/ui/fx.ts b/src/renderer/ui/fx.ts index 936453a..cfe067e 100644 --- a/src/renderer/ui/fx.ts +++ b/src/renderer/ui/fx.ts @@ -1,4 +1,4 @@ -import { FxGate, FxKind } from '../game/core/fxqueue' +import { FxGate, FxKind } from '../game/engine/kernel/fxqueue' import { seasonOf } from '../game/data/season' let gate: FxGate | null = null diff --git a/src/renderer/ui/panels/DiplomacyPanel.tsx b/src/renderer/ui/panels/DiplomacyPanel.tsx index f942fe2..52aeed6 100644 --- a/src/renderer/ui/panels/DiplomacyPanel.tsx +++ b/src/renderer/ui/panels/DiplomacyPanel.tsx @@ -1,6 +1,6 @@ import { useGameStore } from '../store' import { npcById } from '../../game/data/npcs' -import { giftNpc, makePeace, marryNpcFamily, calcGiftGain, GIFT_TIERS } from '../../game/engine/systems/diplomacy' +import { giftNpc, makePeace, marryNpcFamily, calcGiftGain, GIFT_TIERS } from '../../game/engine/runtime/Systems/diplomacy' import { useMemo } from 'react' import { MAJOR_NAMES } from '../../game/data/realms' diff --git a/src/renderer/ui/panels/ExpeditionPanel.tsx b/src/renderer/ui/panels/ExpeditionPanel.tsx index bceda83..91c6401 100644 --- a/src/renderer/ui/panels/ExpeditionPanel.tsx +++ b/src/renderer/ui/panels/ExpeditionPanel.tsx @@ -1,7 +1,7 @@ import { useGameStore } from '../store' import { MISSIONS, missionById } from '../../game/data/secrets' -import { sendMission, recallAll } from '../../game/engine/systems/missions' -import { combatPowerOf } from '../../game/engine/systems/combat' +import { sendMission, recallAll } from '../../game/engine/runtime/Systems/missions' +import { combatPowerOf } from '../../game/engine/runtime/Systems/combat' import { useState } from 'react' import { describeRealm, MAJOR_ORDER } from '../../game/data/realms' import { FORMATIONS, FormationId } from '../../game/data/formations' diff --git a/src/renderer/ui/panels/GenealogyPanel.tsx b/src/renderer/ui/panels/GenealogyPanel.tsx index 9b77ca1..bdb1ac2 100644 --- a/src/renderer/ui/panels/GenealogyPanel.tsx +++ b/src/renderer/ui/panels/GenealogyPanel.tsx @@ -1,5 +1,5 @@ import { useGameStore } from '../store' -import { computeGenealogy } from '../../game/core/genealogy' +import { computeGenealogy } from '../../game/engine/narrative/genealogy' import { describeRealm } from '../../game/data/realms' import { Character, FamilyState } from '../../game/types/domain' import { useState } from 'react' diff --git a/src/renderer/ui/panels/LegacyPanel.tsx b/src/renderer/ui/panels/LegacyPanel.tsx index b6771b6..5a419ff 100644 --- a/src/renderer/ui/panels/LegacyPanel.tsx +++ b/src/renderer/ui/panels/LegacyPanel.tsx @@ -1,11 +1,11 @@ import { useState } from 'react' import { useGameStore } from '../store' -import { computeLegacy, resolveLegacy } from '../../game/core/legacy' -import { resolveLegacy as doesIt } from '../../game/core/legacy' +import { computeLegacy, resolveLegacy } from '../../game/engine/narrative/legacy' +import { resolveLegacy as doesIt } from '../../game/engine/narrative/legacy' import { ResolveModal } from '../components/ResolveModal' -import { buildBiography } from '../../game/core/biography' -import { yearAxis, decadeLabel } from '../../game/core/yearaxis' -import { buildReport, verdictLine } from '../../game/core/legacyreport' +import { buildBiography } from '../../game/engine/narrative/biography' +import { yearAxis, decadeLabel } from '../../game/engine/narrative/yearaxis' +import { buildReport, verdictLine } from '../../game/engine/narrative/legacyreport' void doesIt diff --git a/src/renderer/ui/panels/MarketPanel.tsx b/src/renderer/ui/panels/MarketPanel.tsx index 5abc866..b179df2 100644 --- a/src/renderer/ui/panels/MarketPanel.tsx +++ b/src/renderer/ui/panels/MarketPanel.tsx @@ -2,7 +2,7 @@ import { useGameStore } from '../store' import { ITEMS } from '../../game/data/items' import { TECHNIQUES } from '../../game/data/techniques' import { techniqueGradeName } from '../../game/data/realms' -import { marketPrice, buyItem, sellItem, buyTechnique } from '../../game/engine/market' +import { marketPrice, buyItem, sellItem, buyTechnique } from '../../game/engine/sim/Market' import { useMemo, useState } from 'react' export default function MarketPanel() { diff --git a/src/renderer/ui/panels/SettingsPanel.tsx b/src/renderer/ui/panels/SettingsPanel.tsx index 5adcb7e..ee6c116 100644 --- a/src/renderer/ui/panels/SettingsPanel.tsx +++ b/src/renderer/ui/panels/SettingsPanel.tsx @@ -1,9 +1,9 @@ import { useState } from 'react' import { useGameStore } from '../store' -import { examplePlugin } from '../../game/engine/demo-plugins' +import { examplePlugin } from '../../game/engine/runtime/demo-plugins' import { ensureFx } from '../fx' -import { SYSTEM_DEFS } from '../../game/engine/capabilities' -import { buildBiography } from '../../game/core/biography' +import { SYSTEM_DEFS } from '../../game/engine/runtime/capabilities' +import { buildBiography } from '../../game/engine/narrative/biography' export default function SettingsPanel() { const world = useGameStore((s) => s.world) diff --git a/src/renderer/ui/screens/GameScreen.tsx b/src/renderer/ui/screens/GameScreen.tsx index 8740ae4..8292d8e 100644 --- a/src/renderer/ui/screens/GameScreen.tsx +++ b/src/renderer/ui/screens/GameScreen.tsx @@ -12,9 +12,9 @@ import ChroniclePanel from '../panels/ChroniclePanel' import SettingsPanel from '../panels/SettingsPanel' import { LogFeed } from '../components/LogFeed' import { UrgentBadges } from '../components/UrgentBadges' -import { fmt as fmtNum } from '../../game/core/format' +import { fmt as fmtNum } from '../../game/engine/kernel/format' import { seasonOf } from '../../game/data/season' -import { seasonTint, yearRing, tideOf } from '../../game/core/timesense' +import { seasonTint, yearRing, tideOf } from '../../game/engine/kernel/timesense' import landscapeUrl from '../../assets/gen/landscape-gold.svg' import { GuideStrip } from '../components/GuideStrip' diff --git a/src/renderer/ui/screens/NewGame.tsx b/src/renderer/ui/screens/NewGame.tsx index bf8af2c..d32556c 100644 --- a/src/renderer/ui/screens/NewGame.tsx +++ b/src/renderer/ui/screens/NewGame.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react' import { useGameStore } from '../store' -import { SURNAME_POOL } from '../../game/core/names' -import { RngHub } from '../../game/core/rng' +import { SURNAME_POOL } from '../../game/engine/kernel/names' +import { RngHub } from '../../game/engine/kernel/rng' export default function NewGame() { const go = useGameStore((s) => s.go) diff --git a/src/renderer/ui/sound.ts b/src/renderer/ui/sound.ts index 3b6ca02..bdd0aed 100644 --- a/src/renderer/ui/sound.ts +++ b/src/renderer/ui/sound.ts @@ -1,5 +1,5 @@ // 合成音效:鼓点·钟鸣·纸韵(Web Audio,零素材依赖) -import { RngHub } from '../game/core/rng' +import { RngHub } from '../game/engine/kernel/rng' let ctx: AudioContext | null = null let enabled = true diff --git a/src/renderer/ui/store.ts b/src/renderer/ui/store.ts index 2aca894..52602e9 100644 --- a/src/renderer/ui/store.ts +++ b/src/renderer/ui/store.ts @@ -1,13 +1,13 @@ import { create } from 'zustand' -import { World, WorldEventBus } from '../game/engine/world' +import { World, WorldEventBus } from '../game/engine/runtime/World' import { EventDef } from '../game/data/events' -import { findEvent, applyEventChoice } from '../game/engine/systems/events' +import { findEvent, applyEventChoice } from '../game/engine/runtime/Systems/events' import { BattleLog, ChronicleEntry, GameState, LogItem, SaveMeta, YearlyReport, SnapshotMeta } from '../game/types/domain' import { getSlotManager, getSaveSlot } from '../game/storage/db' import { metaFromState, updateSlotMeta } from './storeHelper' -import { GameFacade, ActName } from '../game/engine/api' +import { GameFacade, ActName } from '../game/engine/runtime/ApiFacade' import { setSoundEnabled, sPaper, sGood, sBad, sWar, sBell, sGong, sClick, sTick } from './sound' -import type { PhaseStat } from '../game/core/clock' +import type { PhaseStat } from '../game/engine/kernel/clock' import { seasonOf } from '../game/data/season' export type Screen = 'boot' | 'newgame' | 'game' @@ -63,7 +63,7 @@ export interface GameStore { facade?: GameFacade advancing: boolean setNextToast: (msg: string) => void - act: (name: ActName, payload: import('../game/engine/api').ActPayload) => boolean + act: (name: ActName, payload: import('../game/engine/runtime/ApiFacade').ActPayload) => boolean } const LOG_CAP = 260 @@ -193,7 +193,7 @@ export const useGameStore = create((set, get) => ({ const elapsed = performance.now() - t0 try { const nextInv = { ...w.state.family.inventory, stones: w.state.family.stones } - const FxGate = (await import('../game/core/fxqueue')).FxGate + const FxGate = (await import('../game/engine/kernel/fxqueue')).FxGate const deltas = FxGate.deltas(prevInv, nextInv) const windowRef = window as unknown as { dispatchEvent: (e: Event) => void } windowRef.dispatchEvent(new CustomEvent('fx:drift', { detail: deltas })) @@ -454,7 +454,7 @@ function makeBus(st: GameStore): WorldEventBus { } } -function actDirect(w: World, name: ActName, payload: import('../game/engine/api').ActPayload): boolean { +function actDirect(w: World, name: ActName, payload: import('../game/engine/runtime/ApiFacade').ActPayload): boolean { if (name === 'legacy.resolve') return (w.resolveLegacyNow(), true) if (name === 'estate.rite') return w.ancestralRite() if (name === 'estate.sutra') return w.seekSutra() diff --git a/tests/api-matrix.test.ts b/tests/api-matrix.test.ts index 5186808..3009710 100644 --- a/tests/api-matrix.test.ts +++ b/tests/api-matrix.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { GameFacade, ACT_CATALOG, ActName } from '../src/renderer/game/engine/api' +import { World } from '../src/renderer/game/engine/runtime/World' +import { GameFacade, ACT_CATALOG, ActName } from '../src/renderer/game/engine/runtime/ApiFacade' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/aspiration-trib-bio.test.ts b/tests/aspiration-trib-bio.test.ts index 02fbb28..0812925 100644 --- a/tests/aspiration-trib-bio.test.ts +++ b/tests/aspiration-trib-bio.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { monthlyRate, resolveBreakthrough } from '../src/renderer/game/engine/systems/cultivation' -import { combatPowerOf } from '../src/renderer/game/engine/systems/combat' +import { World } from '../src/renderer/game/engine/runtime/World' +import { monthlyRate, resolveBreakthrough } from '../src/renderer/game/engine/runtime/Systems/cultivation' +import { combatPowerOf } from '../src/renderer/game/engine/runtime/Systems/combat' import { isFit } from '../src/renderer/game/data/aspirations' -import { needsTribulation, resolveTribulation, tribulationEventId } from '../src/renderer/game/engine/systems/tribulation' -import { buildBiography } from '../src/renderer/game/core/biography' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +import { needsTribulation, resolveTribulation, tribulationEventId } from '../src/renderer/game/engine/runtime/Systems/tribulation' +import { buildBiography } from '../src/renderer/game/engine/narrative/biography' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/audit-fix-0.1.11.test.ts b/tests/audit-fix-0.1.11.test.ts index 1900308..c2520d2 100644 --- a/tests/audit-fix-0.1.11.test.ts +++ b/tests/audit-fix-0.1.11.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' -import { computeUrgency } from '../src/renderer/game/core/urgency' -import { monthlyRate } from '../src/renderer/game/engine/systems/cultivation' +import { World } from '../src/renderer/game/engine/runtime/World' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' +import { computeUrgency } from '../src/renderer/game/engine/kernel/urgency' +import { monthlyRate } from '../src/renderer/game/engine/runtime/Systems/cultivation' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/audit-regression.test.ts b/tests/audit-regression.test.ts index 7803641..fae00ed 100644 --- a/tests/audit-regression.test.ts +++ b/tests/audit-regression.test.ts @@ -1,13 +1,13 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { newCharacter } from '../src/renderer/game/engine/pcgen' -import { Rng, seedToRng } from '../src/renderer/game/core/rng' +import { World } from '../src/renderer/game/engine/runtime/World' +import { newCharacter } from '../src/renderer/game/engine/runtime/pcgen' +import { Rng, seedToRng } from '../src/renderer/game/engine/kernel/rng' import { PACK } from '../src/renderer/game/data/registry' -import { buildApprentice } from '../src/renderer/game/engine/systems/tournament' -import { sendMission } from '../src/renderer/game/engine/systems/missions' -import { buyItem, marketPrice } from '../src/renderer/game/engine/market' -import { findEvent } from '../src/renderer/game/engine/systems/events' -import { runTournament } from '../src/renderer/game/engine/systems/tournament' +import { buildApprentice } from '../src/renderer/game/engine/runtime/Systems/tournament' +import { sendMission } from '../src/renderer/game/engine/runtime/Systems/missions' +import { buyItem, marketPrice } from '../src/renderer/game/engine/sim/Market' +import { findEvent } from '../src/renderer/game/engine/runtime/Systems/events' +import { runTournament } from '../src/renderer/game/engine/runtime/Systems/tournament' import { stateFingerprint, longRun } from './fingerprint.helper' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/audit.test.ts b/tests/audit.test.ts index 2c0a4d5..617ad2f 100644 --- a/tests/audit.test.ts +++ b/tests/audit.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest' -import { World, normalizeGameState } from '../src/renderer/game/engine/world' +import { World, normalizeGameState } from '../src/renderer/game/engine/runtime/World' import { marryNpcFamily, makePeace -} from '../src/renderer/game/engine/systems/diplomacy' -import { sendMission, recallAll } from '../src/renderer/game/engine/systems/missions' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +} from '../src/renderer/game/engine/runtime/Systems/diplomacy' +import { sendMission, recallAll } from '../src/renderer/game/engine/runtime/Systems/missions' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { GameState } from '../src/renderer/game/types/domain' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/balance-edge.test.ts b/tests/balance-edge.test.ts index 3fe14ee..18b137c 100644 --- a/tests/balance-edge.test.ts +++ b/tests/balance-edge.test.ts @@ -1,13 +1,13 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { monthlyRate } from '../src/renderer/game/engine/systems/cultivation' -import { combatPowerOf } from '../src/renderer/game/engine/systems/combat' -import { resolveBreakthrough } from '../src/renderer/game/engine/systems/cultivation' -import { computeLegacy, resolveLegacy } from '../src/renderer/game/core/legacy' -import { yearAxis } from '../src/renderer/game/core/yearaxis' -import { buildBiography } from '../src/renderer/game/core/biography' -import { computeGenealogy } from '../src/renderer/game/core/genealogy' -import { marketPrice, buyItem, sellItem } from '../src/renderer/game/engine/market' +import { World } from '../src/renderer/game/engine/runtime/World' +import { monthlyRate } from '../src/renderer/game/engine/runtime/Systems/cultivation' +import { combatPowerOf } from '../src/renderer/game/engine/runtime/Systems/combat' +import { resolveBreakthrough } from '../src/renderer/game/engine/runtime/Systems/cultivation' +import { computeLegacy, resolveLegacy } from '../src/renderer/game/engine/narrative/legacy' +import { yearAxis } from '../src/renderer/game/engine/narrative/yearaxis' +import { buildBiography } from '../src/renderer/game/engine/narrative/biography' +import { computeGenealogy } from '../src/renderer/game/engine/narrative/genealogy' +import { marketPrice, buyItem, sellItem } from '../src/renderer/game/engine/sim/Market' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/clock-season-axis.test.ts b/tests/clock-season-axis.test.ts index 41b5b23..8c69549 100644 --- a/tests/clock-season-axis.test.ts +++ b/tests/clock-season-axis.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { GameClock, PHASE_ORDER } from '../src/renderer/game/core/clock' -import { buildClock } from '../src/renderer/game/engine/clocks' -import { RngHub } from '../src/renderer/game/core/rng' +import { World } from '../src/renderer/game/engine/runtime/World' +import { GameClock, PHASE_ORDER } from '../src/renderer/game/engine/kernel/clock' +import { buildClock } from '../src/renderer/game/engine/runtime/clocks' +import { RngHub } from '../src/renderer/game/engine/kernel/rng' import { seasonOf, seasonMod, SEASON } from '../src/renderer/game/data/season' -import { yearAxis, decadeLabel } from '../src/renderer/game/core/yearaxis' +import { yearAxis, decadeLabel } from '../src/renderer/game/engine/narrative/yearaxis' import { stateFingerprint } from './fingerprint.helper' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/clock.test.ts b/tests/clock.test.ts index 74daa97..8e65ae8 100644 --- a/tests/clock.test.ts +++ b/tests/clock.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { stateFingerprint, longRun } from './fingerprint.helper' -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' /** * 金钟罩:固定种子长跑 560 月的状态指纹。 diff --git a/tests/combat-missions.test.ts b/tests/combat-missions.test.ts index abe5e35..72a73f0 100644 --- a/tests/combat-missions.test.ts +++ b/tests/combat-missions.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { combatPowerOf, resolveEncounter, resolveRaid, rollWarbooty } from '../src/renderer/game/engine/systems/combat' +import { World } from '../src/renderer/game/engine/runtime/World' +import { combatPowerOf, resolveEncounter, resolveRaid, rollWarbooty } from '../src/renderer/game/engine/runtime/Systems/combat' import { ENEMIES } from '../src/renderer/game/data/secrets' -import { sendMission, recallAll } from '../src/renderer/game/engine/systems/missions' +import { sendMission, recallAll } from '../src/renderer/game/engine/runtime/Systems/missions' import { missionById } from '../src/renderer/game/data/secrets' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/core-extra.test.ts b/tests/core-extra.test.ts index 798e1a4..1a83ce3 100644 --- a/tests/core-extra.test.ts +++ b/tests/core-extra.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { applyEventChoice, applyEffect } from '../src/renderer/game/engine/systems/events' +import { World } from '../src/renderer/game/engine/runtime/World' +import { applyEventChoice, applyEffect } from '../src/renderer/game/engine/runtime/Systems/events' import { EffectDef } from '../src/renderer/game/data/events' import { Character } from '../src/renderer/game/types/domain' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/data.test.ts b/tests/data.test.ts index 5f3e69a..62bad7e 100644 --- a/tests/data.test.ts +++ b/tests/data.test.ts @@ -22,7 +22,7 @@ import { NPCS, npcById } from '../src/renderer/game/data/npcs' import { POSTS, POST_ORDER } from '../src/renderer/game/data/posts' import { EVENTS } from '../src/renderer/game/data/events' import { MAJOR_RATE, masteryRateOfMajor } from '../src/renderer/game/data/pacing' -import { SURNAME_POOL, MALE_GIVEN, FEMALE_GIVEN } from '../src/renderer/game/core/names' +import { SURNAME_POOL, MALE_GIVEN, FEMALE_GIVEN } from '../src/renderer/game/engine/kernel/names' import { TRAITS } from '../src/renderer/game/data/traits' describe('realms 境界表', () => { diff --git a/tests/echo.test.ts b/tests/echo.test.ts index f2727ba..6d9f2b3 100644 --- a/tests/echo.test.ts +++ b/tests/echo.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { applyEventChoice, eventRoll } from '../src/renderer/game/engine/systems/events' +import { World } from '../src/renderer/game/engine/runtime/World' +import { applyEventChoice, eventRoll } from '../src/renderer/game/engine/runtime/Systems/events' describe('echo 四邻回声', () => { function baseWorld(seed: string): World { diff --git a/tests/economy.test.ts b/tests/economy.test.ts index 2f7ac48..c0b5856 100644 --- a/tests/economy.test.ts +++ b/tests/economy.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { marketPrice, buyItem, sellItem, buyTechnique, techniquePrice } from '../src/renderer/game/engine/market' +import { World } from '../src/renderer/game/engine/runtime/World' +import { marketPrice, buyItem, sellItem, buyTechnique, techniquePrice } from '../src/renderer/game/engine/sim/Market' import { ITEMS } from '../src/renderer/game/data/items' describe('economy 经济系统', () => { diff --git a/tests/event-state-matrix.test.ts b/tests/event-state-matrix.test.ts index bdb8b2d..e31e264 100644 --- a/tests/event-state-matrix.test.ts +++ b/tests/event-state-matrix.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' -import { World, normalizeGameState } from '../src/renderer/game/engine/world' +import { World, normalizeGameState } from '../src/renderer/game/engine/runtime/World' import { EVENTS, EffectDef } from '../src/renderer/game/data/events' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { POSTS } from '../src/renderer/game/data/posts' import { ASPIRATIONS } from '../src/renderer/game/data/aspirations' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/events.helpers.ts b/tests/events.helpers.ts index 04b1639..46521b6 100644 --- a/tests/events.helpers.ts +++ b/tests/events.helpers.ts @@ -1,5 +1,5 @@ -import { World } from '../src/renderer/game/engine/world' -import { matchesCond } from '../src/renderer/game/engine/systems/events' +import { World } from '../src/renderer/game/engine/runtime/World' +import { matchesCond } from '../src/renderer/game/engine/runtime/Systems/events' import { Cond } from '../src/renderer/game/data/events' export function matchesCondPub(w: World, cond?: Cond): boolean { diff --git a/tests/events.test.ts b/tests/events.test.ts index e694767..9a1ec23 100644 --- a/tests/events.test.ts +++ b/tests/events.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { matchesCond, applyEventChoice, findEvent, eventRoll } from '../src/renderer/game/engine/systems/events' +import { World } from '../src/renderer/game/engine/runtime/World' +import { matchesCond, applyEventChoice, findEvent, eventRoll } from '../src/renderer/game/engine/runtime/Systems/events' import { EVENTS } from '../src/renderer/game/data/events' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/facade-registry.test.ts b/tests/facade-registry.test.ts index f7dee48..161cb60 100644 --- a/tests/facade-registry.test.ts +++ b/tests/facade-registry.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { GameFacade } from '../src/renderer/game/engine/api' -import { SYSTEM_DEFS } from '../src/renderer/game/engine/capabilities' +import { World } from '../src/renderer/game/engine/runtime/World' +import { GameFacade } from '../src/renderer/game/engine/runtime/ApiFacade' +import { SYSTEM_DEFS } from '../src/renderer/game/engine/runtime/capabilities' import { PACK, pack, DEFAULT_PACK } from '../src/renderer/game/data/registry' -import { marketPrice } from '../src/renderer/game/engine/market' +import { marketPrice } from '../src/renderer/game/engine/sim/Market' import { stateFingerprint, longRun } from './fingerprint.helper' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/feature-0.1.9.test.ts b/tests/feature-0.1.9.test.ts index 9d3ea89..2c85324 100644 --- a/tests/feature-0.1.9.test.ts +++ b/tests/feature-0.1.9.test.ts @@ -1,12 +1,12 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { buildReport, verdictLine } from '../src/renderer/game/core/legacyreport' +import { World } from '../src/renderer/game/engine/runtime/World' +import { buildReport, verdictLine } from '../src/renderer/game/engine/narrative/legacyreport' import { migrateIfNeeded, exportEnvelope, parseImportEnvelope, CURRENT_SCHEMA, APP_ID } from '../src/renderer/game/storage/migrate' import { FORMATIONS, formationById, FormationId } from '../src/renderer/game/data/formations' -import { resolveEncounter } from '../src/renderer/game/engine/systems/combat' +import { resolveEncounter } from '../src/renderer/game/engine/runtime/Systems/combat' import { ENEMIES } from '../src/renderer/game/data/secrets' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' -import { sendMission } from '../src/renderer/game/engine/systems/missions' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' +import { sendMission } from '../src/renderer/game/engine/runtime/Systems/missions' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/fingerprint.helper.ts b/tests/fingerprint.helper.ts index dbbf928..ba061d4 100644 --- a/tests/fingerprint.helper.ts +++ b/tests/fingerprint.helper.ts @@ -1,4 +1,4 @@ -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' import { GameState } from '../src/renderer/game/types/domain' export function stateFingerprint(s: GameState): string { diff --git a/tests/fx-timesense.test.ts b/tests/fx-timesense.test.ts index cdc9c1b..07fe48f 100644 --- a/tests/fx-timesense.test.ts +++ b/tests/fx-timesense.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { seasonOf } from '../src/renderer/game/data/season' -import { tideOf, yearRing, seasonTint, seasonCssVars, TIDES } from '../src/renderer/game/core/timesense' -import { FxGate, FxKind } from '../src/renderer/game/core/fxqueue' +import { tideOf, yearRing, seasonTint, seasonCssVars, TIDES } from '../src/renderer/game/engine/kernel/timesense' +import { FxGate, FxKind } from '../src/renderer/game/engine/kernel/fxqueue' describe('timesense 时间感知矩阵', () => { it.each([[1, 'spring'], [3, 'spring'], [4, 'summer'], [6, 'summer'], [7, 'autumn'], [9, 'autumn'], [10, 'winter'], [12, 'winter']] as const)( diff --git a/tests/helpers/examplePlugin.ts b/tests/helpers/examplePlugin.ts index cc8fcf9..48fdbb5 100644 --- a/tests/helpers/examplePlugin.ts +++ b/tests/helpers/examplePlugin.ts @@ -1,4 +1,4 @@ -import { CotycPlugin } from '../../src/renderer/game/core/plugin' +import { CotycPlugin } from '../../src/renderer/game/engine/kernel/plugin' /** 示例内容插件:注入事件池 + 一个护山能力(开发范本) */ export const examplePlugin: CotycPlugin = { diff --git a/tests/legacy-tournament.test.ts b/tests/legacy-tournament.test.ts index c5414af..830867a 100644 --- a/tests/legacy-tournament.test.ts +++ b/tests/legacy-tournament.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount } from '../src/renderer/game/core/legacy' -import { runTournament, buildApprentice, finalizeApprentice, apprenticeCandidates } from '../src/renderer/game/engine/systems/tournament' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +import { World } from '../src/renderer/game/engine/runtime/World' +import { computeLegacy, resolveLegacy, peakRealmIndex, grandTechniqueCount } from '../src/renderer/game/engine/narrative/legacy' +import { runTournament, buildApprentice, finalizeApprentice, apprenticeCandidates } from '../src/renderer/game/engine/runtime/Systems/tournament' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/longevity.test.ts b/tests/longevity.test.ts index df775ac..4682a66 100644 --- a/tests/longevity.test.ts +++ b/tests/longevity.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +import { World } from '../src/renderer/game/engine/runtime/World' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { resetSaveBus, attachLogSink } from './world.helpers' const SEEDS = ['long-a', 'long-b', 'long-c'] diff --git a/tests/marriage-diplomacy.test.ts b/tests/marriage-diplomacy.test.ts index c25596e..6bb31e2 100644 --- a/tests/marriage-diplomacy.test.ts +++ b/tests/marriage-diplomacy.test.ts @@ -1,13 +1,13 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' import { giftNpc, marryNpcFamily, makePeace, arrangeWedding, diplomacyTick -} from '../src/renderer/game/engine/systems/diplomacy' -import { yearStartMarriage } from '../src/renderer/game/engine/systems/marriage' +} from '../src/renderer/game/engine/runtime/Systems/diplomacy' +import { yearStartMarriage } from '../src/renderer/game/engine/runtime/Systems/marriage' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { @@ -189,7 +189,7 @@ describe('genealogy 谱系结构', () => { }) }) -import { computeGenealogy } from '../src/renderer/game/core/genealogy' +import { computeGenealogy } from '../src/renderer/game/engine/narrative/genealogy' function computeGenealogyLocal(w: World) { return computeGenealogy(w) } diff --git a/tests/modal-0.1.12.test.ts b/tests/modal-0.1.12.test.ts index d3cab2c..db14847 100644 --- a/tests/modal-0.1.12.test.ts +++ b/tests/modal-0.1.12.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { calcGiftGain, GIFT_TIERS, giftNpc } from '../src/renderer/game/engine/systems/diplomacy' +import { World } from '../src/renderer/game/engine/runtime/World' +import { calcGiftGain, GIFT_TIERS, giftNpc } from '../src/renderer/game/engine/runtime/Systems/diplomacy' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { diff --git a/tests/pcgen-cultivation.test.ts b/tests/pcgen-cultivation.test.ts index 33d5118..1666841 100644 --- a/tests/pcgen-cultivation.test.ts +++ b/tests/pcgen-cultivation.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { Rng, seedToRng } from '../src/renderer/game/core/rng' -import { newCharacter, rollAttributes, rollRoots, rollPersonality, traitBonuses, calcLifespan } from '../src/renderer/game/engine/pcgen' -import { monthlyRate, perAttemptChance } from '../src/renderer/game/engine/systems/cultivation' -import { lifespanOf } from '../src/renderer/game/engine/systems/lifecycle' +import { World } from '../src/renderer/game/engine/runtime/World' +import { Rng, seedToRng } from '../src/renderer/game/engine/kernel/rng' +import { newCharacter, rollAttributes, rollRoots, rollPersonality, traitBonuses, calcLifespan } from '../src/renderer/game/engine/runtime/pcgen' +import { monthlyRate, perAttemptChance } from '../src/renderer/game/engine/runtime/Systems/cultivation' +import { lifespanOf } from '../src/renderer/game/engine/runtime/Systems/lifecycle' function rng(): Rng { return new Rng(seedToRng('pcgen')) diff --git a/tests/plugin.test.ts b/tests/plugin.test.ts index 3792751..e4883db 100644 --- a/tests/plugin.test.ts +++ b/tests/plugin.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { GameFacade } from '../src/renderer/game/engine/api' -import { installCoreSystems, buildClock } from '../src/renderer/game/engine/clocks' -import { emptyClock } from '../src/renderer/game/engine/clocks' -import { CORE_PLUGINS } from '../src/renderer/game/engine/plugin-bootstrap' +import { World } from '../src/renderer/game/engine/runtime/World' +import { GameFacade } from '../src/renderer/game/engine/runtime/ApiFacade' +import { installCoreSystems, buildClock } from '../src/renderer/game/engine/runtime/clocks' +import { emptyClock } from '../src/renderer/game/engine/runtime/clocks' +import { CORE_PLUGINS } from '../src/renderer/game/engine/runtime/plugin-bootstrap' import { examplePlugin, brokenPlugin } from './helpers/examplePlugin' import { stateFingerprint, longRun } from './fingerprint.helper' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/rebuild-0.1.10.test.ts b/tests/rebuild-0.1.10.test.ts index c7cea7b..eb293b8 100644 --- a/tests/rebuild-0.1.10.test.ts +++ b/tests/rebuild-0.1.10.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { monthlyRate } from '../src/renderer/game/engine/systems/cultivation' +import { World } from '../src/renderer/game/engine/runtime/World' +import { monthlyRate } from '../src/renderer/game/engine/runtime/Systems/cultivation' import { MAJORS } from '../src/renderer/game/data/realms' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { resetSaveBus, attachLogSink } from './world.helpers' function baseWorld(seed: string): World { @@ -73,8 +73,8 @@ describe('0.1.10 数值重建验收', () => { }) }) -import { resolveBreakthrough } from '../src/renderer/game/engine/systems/cultivation' -import { perTribChance } from '../src/renderer/game/engine/systems/tribulation' +import { resolveBreakthrough } from '../src/renderer/game/engine/runtime/Systems/cultivation' +import { perTribChance } from '../src/renderer/game/engine/runtime/Systems/tribulation' describe('事件悬置与周期(0.1.10)', () => { it('大比征召 FIFO 不被拍卖/传薪挤掉(20 年三年都触发)', () => { diff --git a/tests/rng-matrix.test.ts b/tests/rng-matrix.test.ts index f3c2fde..5642527 100644 --- a/tests/rng-matrix.test.ts +++ b/tests/rng-matrix.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { Rng, seedToRng, RngHub } from '../src/renderer/game/core/rng' +import { Rng, seedToRng, RngHub } from '../src/renderer/game/engine/kernel/rng' describe('RNG 多种子矩阵', () => { it.each([ diff --git a/tests/rng.test.ts b/tests/rng.test.ts index f359d9f..413e834 100644 --- a/tests/rng.test.ts +++ b/tests/rng.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { Rng, seedToRng } from '../src/renderer/game/core/rng' +import { Rng, seedToRng } from '../src/renderer/game/engine/kernel/rng' describe('Rng.sfc32 特性', () => { it('同一种子产生的序列完全一致', () => { diff --git a/tests/save-ext.test.ts b/tests/save-ext.test.ts index 49aa8e8..4d8db6b 100644 --- a/tests/save-ext.test.ts +++ b/tests/save-ext.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' import { SaveSlot, SaveDbDriver } from '../src/renderer/game/storage/slots' -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' interface Row { [k: string]: unknown diff --git a/tests/save.test.ts b/tests/save.test.ts index 81d715f..25ff9d7 100644 --- a/tests/save.test.ts +++ b/tests/save.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { SaveSlot, SaveDbDriver } from '../src/renderer/game/storage/slots' import { GameState } from '../src/renderer/game/types/domain' -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' interface Row { [k: string]: unknown diff --git a/tests/systems.test.ts b/tests/systems.test.ts index fcdba18..2785046 100644 --- a/tests/systems.test.ts +++ b/tests/systems.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { combatPowerOf } from '../src/renderer/game/engine/systems/combat' -import { marketPrice, buyItem, sellItem, buyTechnique } from '../src/renderer/game/engine/market' -import { resolveBreakthrough, monthlyRate } from '../src/renderer/game/engine/systems/cultivation' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' -import { computeGenealogy } from '../src/renderer/game/core/genealogy' +import { World } from '../src/renderer/game/engine/runtime/World' +import { combatPowerOf } from '../src/renderer/game/engine/runtime/Systems/combat' +import { marketPrice, buyItem, sellItem, buyTechnique } from '../src/renderer/game/engine/sim/Market' +import { resolveBreakthrough, monthlyRate } from '../src/renderer/game/engine/runtime/Systems/cultivation' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' +import { computeGenealogy } from '../src/renderer/game/engine/narrative/genealogy' import { matchesCondPub } from './events.helpers' import { resetSaveBus, attachLogSink } from './world.helpers' diff --git a/tests/ux-0.1.11.test.ts b/tests/ux-0.1.11.test.ts index 3efa87f..a9643e5 100644 --- a/tests/ux-0.1.11.test.ts +++ b/tests/ux-0.1.11.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { computeUrgency } from '../src/renderer/game/core/urgency' -import { computeGuide, GUIDE_STEPS, guideAdvance } from '../src/renderer/game/core/guide' -import { fmt } from '../src/renderer/game/core/format' +import { World } from '../src/renderer/game/engine/runtime/World' +import { computeUrgency } from '../src/renderer/game/engine/kernel/urgency' +import { computeGuide, GUIDE_STEPS, guideAdvance } from '../src/renderer/game/engine/kernel/guide' +import { fmt } from '../src/renderer/game/engine/kernel/format' function baseWorld(seed: string): World { return World.create({ seed, surname: '舒', familyName: '舒家', motto: 'm', difficulty: 'normal' }) diff --git a/tests/world-lifecycle.test.ts b/tests/world-lifecycle.test.ts index a73dc26..fc21421 100644 --- a/tests/world-lifecycle.test.ts +++ b/tests/world-lifecycle.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' -import { createWorldState, NewGameOptions, findInheritor } from '../src/renderer/game/engine/creation' +import { World } from '../src/renderer/game/engine/runtime/World' +import { createWorldState, NewGameOptions, findInheritor } from '../src/renderer/game/engine/runtime/creation' import { resetSaveBus, attachLogSink } from './world.helpers' function opts(seed: string, difficulty: 'easy' | 'normal' | 'hard' = 'normal', surname = '彭'): NewGameOptions { diff --git a/tests/world-matrix.test.ts b/tests/world-matrix.test.ts index 17c7a87..f1c9b21 100644 --- a/tests/world-matrix.test.ts +++ b/tests/world-matrix.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' import { stateFingerprint, longRun } from './fingerprint.helper' -import { computeGenealogy } from '../src/renderer/game/core/genealogy' -import { applyEventChoice } from '../src/renderer/game/engine/systems/events' +import { computeGenealogy } from '../src/renderer/game/engine/narrative/genealogy' +import { applyEventChoice } from '../src/renderer/game/engine/runtime/Systems/events' import { resetSaveBus, attachLogSink } from './world.helpers' describe('多 seed 长跑矩阵', () => { diff --git a/tests/world.helpers.ts b/tests/world.helpers.ts index 3e82575..7aa282f 100644 --- a/tests/world.helpers.ts +++ b/tests/world.helpers.ts @@ -1,4 +1,4 @@ -import { World, WorldEventBus } from '../src/renderer/game/engine/world' +import { World, WorldEventBus } from '../src/renderer/game/engine/runtime/World' import { LogItem, ChronicleEntry, BattleLog } from '../src/renderer/game/types/domain' const sinks: Set = new Set() diff --git a/tests/world.test.ts b/tests/world.test.ts index 2e719a5..54f898b 100644 --- a/tests/world.test.ts +++ b/tests/world.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { World } from '../src/renderer/game/engine/world' +import { World } from '../src/renderer/game/engine/runtime/World' import { resetSaveBus, attachLogSink } from './world.helpers' describe('World engine', () => {