Refactor import paths to use absolute paths from '@sammo-ts/logic' for consistency and clarity across the codebase. This includes updates to various modules related to actions, triggers, constraints, and world management, ensuring that all imports are correctly pointing to the new structure.

This commit is contained in:
2026-01-03 08:08:33 +00:00
parent 64953e39a5
commit e10bcba49b
70 changed files with 314 additions and 314 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
import type { Constraint, ConstraintContext } from '../constraints/types.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from './engine.js';
import type { GeneralTriggerState } from '../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
export interface GeneralActionDefinition<
TriggerState extends GeneralTriggerState = GeneralTriggerState,
+4 -4
View File
@@ -8,15 +8,15 @@ import type {
GeneralId,
Nation,
NationId,
} from '../domain/entities.js';
import type { GeneralActionContext } from '../triggers/general.js';
import { getNextTurnAt, type TurnSchedule } from '../turn/calendar.js';
} from '@sammo-ts/logic/domain/entities.js';
import type { GeneralActionContext } from '@sammo-ts/logic/triggers/general.js';
import { getNextTurnAt, type TurnSchedule } from '@sammo-ts/logic/turn/calendar.js';
import {
LogCategory,
type LogEntryDraft,
LogFormat,
LogScope,
} from '../logging/types.js';
} from '@sammo-ts/logic/logging/types.js';
enablePatches();
@@ -1,5 +1,5 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import {
beChief,
destGeneralInDestNation,
@@ -9,15 +9,15 @@ import {
notBeNeutral,
occupiedCity,
suppliedCity,
} from '../../../constraints/presets.js';
import { allow, unknownOrDeny } from '../../../constraints/helpers.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import { allow, unknownOrDeny } from '@sammo-ts/logic/constraints/helpers.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { createDiplomacyPatchEffect, createLogEffect } from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
} from '@sammo-ts/logic/actions/engine.js';
import { createDiplomacyPatchEffect, createLogEffect } from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
export interface NonAggressionAcceptArgs {
destNationId: number;
@@ -1,5 +1,5 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import {
allowDiplomacyBetweenStatus,
beChief,
@@ -7,15 +7,15 @@ import {
existsDestGeneral,
existsDestNation,
notBeNeutral,
} from '../../../constraints/presets.js';
import { allow, unknownOrDeny } from '../../../constraints/helpers.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import { allow, unknownOrDeny } from '@sammo-ts/logic/constraints/helpers.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { createDiplomacyPatchEffect, createLogEffect } from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
} from '@sammo-ts/logic/actions/engine.js';
import { createDiplomacyPatchEffect, createLogEffect } from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
export interface NonAggressionCancelAcceptArgs {
destNationId: number;
@@ -1,7 +1,7 @@
import type { City, General, Nation } from '../../domain/entities.js';
import type { ScenarioConfig } from '../../scenario/types.js';
import type { ScenarioMeta } from '../../world/types.js';
import type { MapDefinition, UnitSetDefinition } from '../../world/types.js';
import type { City, General, Nation } from '@sammo-ts/logic/domain/entities.js';
import type { ScenarioConfig } from '@sammo-ts/logic/scenario/types.js';
import type { ScenarioMeta } from '@sammo-ts/logic/world/types.js';
import type { MapDefinition, UnitSetDefinition } from '@sammo-ts/logic/world/types.js';
export interface ActionRandomSource {
nextFloat(): number;
@@ -1,8 +1,8 @@
import type { General } from '../../domain/entities.js';
import type { ScenarioConfig } from '../../scenario/types.js';
import type { ScenarioMeta } from '../../world/types.js';
import type { WarAftermathConfig, WarEngineConfig, WarTimeContext } from '../../war/types.js';
import type { UnitSetDefinition } from '../../world/types.js';
import type { General } from '@sammo-ts/logic/domain/entities.js';
import type { ScenarioConfig } from '@sammo-ts/logic/scenario/types.js';
import type { ScenarioMeta } from '@sammo-ts/logic/world/types.js';
import type { WarAftermathConfig, WarEngineConfig, WarTimeContext } from '@sammo-ts/logic/war/types.js';
import type { UnitSetDefinition } from '@sammo-ts/logic/world/types.js';
import type {
ActionContextWorldRef,
ActionContextWorldState,
@@ -1,4 +1,4 @@
import type { GeneralActionModule } from '../../triggers/general-action.js';
import type { GeneralActionModule } from '@sammo-ts/logic/triggers/general-action.js';
export interface TurnCommandEnv {
develCost: number;
@@ -1,5 +1,5 @@
import type { GeneralActionDefinition } from '../definition.js';
import type { GeneralActionResolver } from '../engine.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type { GeneralActionResolver } from '@sammo-ts/logic/actions/engine.js';
import type { ActionContextBuilder } from './actionContext.js';
import type { TurnCommandEnv } from './commandEnv.js';
@@ -1,14 +1,14 @@
import type { GeneralTriggerState, TriggerValue } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import { beNeutral } from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
import type { GeneralTriggerState, TriggerValue } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import { beNeutral } from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { LogCategory, LogFormat } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface UprisingArgs {}
@@ -1,14 +1,14 @@
import type { GeneralTriggerState, TriggerValue } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import { beNeutral } from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
import type { GeneralTriggerState, TriggerValue } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import { beNeutral } from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { LogCategory, LogFormat } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface FoundingArgs {}
@@ -1,26 +1,26 @@
import type {
GeneralTriggerState,
Nation,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
StateView,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
notBeNeutral,
notWanderingNation,
occupiedCity,
reqGeneralGold,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface TechResearchArgs {}
@@ -1,7 +1,7 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import { CityDevelopmentActionDefinition } from './cityDevelopment.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export class ActionDefinition<
@@ -1,19 +1,19 @@
import type {
GeneralTriggerState,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
StateView,
} from '../../../constraints/types.js';
import { notBeNeutral, reqGeneralGold } from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/types.js';
import { notBeNeutral, reqGeneralGold } from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface BoostMoraleArgs {}
@@ -4,13 +4,13 @@ import type {
General,
GeneralTriggerState,
Nation,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
RequirementKey,
StateView,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
notBeNeutral,
notWanderingNation,
@@ -19,20 +19,20 @@ import {
reqGeneralGold,
reqGeneralRice,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionContext } from '../../../triggers/general.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionContext } from '@sammo-ts/logic/triggers/general.js';
import {
GeneralActionPipeline,
type GeneralActionModule,
} from '../../../triggers/general-action.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/triggers/general-action.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolver,
GeneralActionResolveContext,
} from '../../engine.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export type DomesticCriticalPick = 'fail' | 'normal' | 'success';
@@ -1,7 +1,7 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import { CityDevelopmentActionDefinition } from './cityDevelopment.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export class ActionDefinition<
@@ -1,7 +1,7 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import { CityDevelopmentActionDefinition } from './cityDevelopment.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export class ActionDefinition<
@@ -1,19 +1,19 @@
import type {
GeneralTriggerState,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
StateView,
} from '../../../constraints/types.js';
import { notBeNeutral, reqGeneralGold } from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/types.js';
import { notBeNeutral, reqGeneralGold } from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface RecoveryArgs {}
@@ -5,34 +5,34 @@ import type {
GeneralTriggerState,
StatBlock,
TriggerValue,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
reqGeneralGold,
reqGeneralRice,
} from '../../../constraints/presets.js';
} from '@sammo-ts/logic/constraints/presets.js';
import {
GeneralActionPipeline,
type GeneralActionModule,
} from '../../../triggers/general-action.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/triggers/general-action.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
import {
createGeneralAddEffect,
} from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import { buildRecruitmentGeneral } from './recruitment.js';
import { JosaUtil } from '@sammo-ts/common';
import type { ActionContextBuilder } from '../actionContext.js';
import { buildWorldSummary } from '../actionContextHelpers.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import { buildWorldSummary } from '@sammo-ts/logic/actions/turn/actionContextHelpers.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface TalentScoutArgs {}
@@ -1,17 +1,17 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
} from '../../../constraints/types.js';
import { beNeutral, existsDestNation } from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/types.js';
import { beNeutral, existsDestNation } from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { LogCategory, LogFormat } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface AppointmentArgs {
@@ -1,7 +1,7 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import { CityDevelopmentActionDefinition } from './cityDevelopment.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export class ActionDefinition<
@@ -4,13 +4,13 @@ import type {
GeneralTriggerState,
Nation,
TriggerValue,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
RequirementKey,
StateView,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
notBeNeutral,
occupiedCity,
@@ -19,28 +19,28 @@ import {
reqGeneralCrewMargin,
reqGeneralGold,
reqGeneralRice,
} from '../../../constraints/presets.js';
} from '@sammo-ts/logic/constraints/presets.js';
import {
GeneralActionPipeline,
type GeneralActionModule,
} from '../../../triggers/general-action.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/triggers/general-action.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
import type { MapDefinition, UnitSetDefinition } from '../../../world/types.js';
import type { ActionContextBuilder } from '../actionContext.js';
import { resolveStartYear } from '../actionContextHelpers.js';
import type { TurnCommandEnv } from '../commandEnv.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { MapDefinition, UnitSetDefinition } from '@sammo-ts/logic/world/types.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import { resolveStartYear } from '@sammo-ts/logic/actions/turn/actionContextHelpers.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { GeneralTurnCommandSpec } from './index.js';
import {
type CrewTypeAvailabilityContext,
findCrewTypeById,
getTechCost,
isCrewTypeAvailable,
} from '../../../world/unitSet.js';
} from '@sammo-ts/logic/world/unitSet.js';
export interface RecruitArgs {
crewType: number;
@@ -3,12 +3,12 @@ import type {
General,
GeneralTriggerState,
Nation,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
StateView,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
existsDestCity,
hasRouteWithEnemy,
@@ -20,44 +20,44 @@ import {
reqGeneralCrew,
reqGeneralRice,
suppliedCity,
} from '../../../constraints/presets.js';
import { readGeneral } from '../../../constraints/helpers.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import { readGeneral } from '@sammo-ts/logic/constraints/helpers.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionEffect,
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
import {
createCityPatchEffect,
createDiplomacyPatchEffect,
createGeneralPatchEffect,
createNationPatchEffect,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
import { JosaUtil, LiteHashDRBG } from '@sammo-ts/common';
import type { TurnCommandEnv } from '../commandEnv.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { GeneralTurnCommandSpec } from './index.js';
import type {
WarAftermathConfig,
WarEngineConfig,
WarTimeContext,
} from '../../../war/types.js';
import { resolveWarAftermath } from '../../../war/aftermath.js';
import { resolveWarBattle } from '../../../war/engine.js';
} from '@sammo-ts/logic/war/types.js';
import { resolveWarAftermath } from '@sammo-ts/logic/war/aftermath.js';
import { resolveWarBattle } from '@sammo-ts/logic/war/engine.js';
import {
increaseMetaNumber,
simpleSerialize,
} from '../../../war/utils.js';
} from '@sammo-ts/logic/war/utils.js';
import type {
MapDefinition,
UnitSetDefinition,
} from '../../../world/types.js';
import type { ActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/world/types.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import {
buildWarAftermathConfig,
buildWarConfig,
buildWarTime,
} from '../actionContextHelpers.js';
} from '@sammo-ts/logic/actions/turn/actionContextHelpers.js';
export interface DispatchArgs {
destCityId: number;
@@ -1,7 +1,7 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import { CityDevelopmentActionDefinition } from './cityDevelopment.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export class ActionDefinition<
@@ -5,8 +5,8 @@ import type {
GeneralTriggerState,
Nation,
TriggerValue,
} from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
} from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import {
disallowDiplomacyBetweenStatus,
existsDestCity,
@@ -17,26 +17,26 @@ import {
reqGeneralGold,
reqGeneralRice,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionContext } from '../../../triggers/general.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionContext } from '@sammo-ts/logic/triggers/general.js';
import {
GeneralActionPipeline,
type GeneralActionModule,
} from '../../../triggers/general-action.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/triggers/general-action.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionEffect,
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
import {
createCityPatchEffect,
createGeneralPatchEffect,
} from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface FireAttackArgs {
@@ -1,19 +1,19 @@
import type {
GeneralTriggerState,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
StateView,
} from '../../../constraints/types.js';
import { notBeNeutral, reqGeneralGold } from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/types.js';
import { notBeNeutral, reqGeneralGold } from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface TrainingArgs {}
@@ -1,12 +1,12 @@
import type {
City,
GeneralTriggerState,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
StateView,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
notBeNeutral,
notWanderingNation,
@@ -14,12 +14,12 @@ import {
remainCityCapacityByMax,
reqGeneralGold,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
export interface CityDevelopmentArgs {}
@@ -1,4 +1,4 @@
import type { TurnCommandModule, TurnCommandSpecBase } from '../commandModule.js';
import type { TurnCommandModule, TurnCommandSpecBase } from '@sammo-ts/logic/actions/turn/commandModule.js';
export const GENERAL_TURN_COMMAND_KEYS = [
'che_거병',
@@ -4,7 +4,7 @@ import type {
GeneralTriggerState,
StatBlock,
TriggerValue,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
export interface GeneralRecruitmentInput<
TriggerState extends GeneralTriggerState = GeneralTriggerState
@@ -1,19 +1,19 @@
import type {
GeneralTriggerState,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
} from '../../../constraints/types.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/types.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
import { LogCategory, LogFormat } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { GeneralTurnCommandSpec } from './index.js';
export interface RestArgs {}
@@ -3,11 +3,11 @@ import type {
General,
GeneralTriggerState,
TriggerValue,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
alwaysFail,
beChief,
@@ -18,20 +18,20 @@ import {
occupiedDestCity,
suppliedCity,
suppliedDestCity,
} from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionEffect,
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
import { createGeneralPatchEffect, createLogEffect } from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
} from '@sammo-ts/logic/actions/engine.js';
import { createGeneralPatchEffect, createLogEffect } from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import { JosaUtil } from '@sammo-ts/common';
import type { ActionContextBuilder } from '../actionContext.js';
import { resolveTurnTermMinutes } from '../actionContextHelpers.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import { resolveTurnTermMinutes } from '@sammo-ts/logic/actions/turn/actionContextHelpers.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { NationTurnCommandSpec } from './index.js';
export interface AssignmentArgs {
@@ -1,22 +1,22 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import {
beChief,
differentDestNation,
disallowDiplomacyBetweenStatus,
existsDestNation,
notBeNeutral,
} from '../../../constraints/presets.js';
import { allow, unknownOrDeny } from '../../../constraints/helpers.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import { allow, unknownOrDeny } from '@sammo-ts/logic/constraints/helpers.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { createLogEffect } from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
import type { ActionContextBuilder } from '../actionContext.js';
import type { TurnCommandEnv } from '../commandEnv.js';
} from '@sammo-ts/logic/actions/engine.js';
import { createLogEffect } from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { NationTurnCommandSpec } from './index.js';
export interface NonAggressionProposalArgs {
@@ -1,5 +1,5 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import {
allowDiplomacyBetweenStatus,
beChief,
@@ -7,16 +7,16 @@ import {
notBeNeutral,
occupiedCity,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { createLogEffect } from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { createLogEffect } from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { NationTurnCommandSpec } from './index.js';
export interface NonAggressionCancelProposalArgs {
@@ -1,5 +1,5 @@
import type { GeneralTriggerState } from '../../../domain/entities.js';
import type { Constraint, ConstraintContext } from '../../../constraints/types.js';
import type { GeneralTriggerState } from '@sammo-ts/logic/domain/entities.js';
import type { Constraint, ConstraintContext } from '@sammo-ts/logic/constraints/types.js';
import {
beChief,
disallowDiplomacyBetweenStatus,
@@ -7,16 +7,16 @@ import {
notBeNeutral,
occupiedCity,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
} from '../../engine.js';
import { createDiplomacyPatchEffect, createLogEffect } from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import { createDiplomacyPatchEffect, createLogEffect } from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { NationTurnCommandSpec } from './index.js';
export interface DeclareWarArgs {
@@ -3,42 +3,42 @@ import type {
GeneralTriggerState,
StatBlock,
TriggerValue,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
availableStrategicCommand,
beChief,
notBeNeutral,
notOpeningPart,
occupiedCity,
} from '../../../constraints/presets.js';
} from '@sammo-ts/logic/constraints/presets.js';
import {
GeneralActionPipeline,
type GeneralActionModule,
} from '../../../triggers/general-action.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/triggers/general-action.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionEffect,
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
import {
createGeneralAddEffect,
} from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
import { buildRecruitmentGeneral } from '../general/recruitment.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import { buildRecruitmentGeneral } from '@sammo-ts/logic/actions/turn/general/recruitment.js';
import { JosaUtil } from '@sammo-ts/common';
import type { ActionContextBuilder } from '../actionContext.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import {
buildAverageNationGeneralCount,
buildNationSummary,
resolveStartYear,
} from '../actionContextHelpers.js';
import type { TurnCommandEnv } from '../commandEnv.js';
} from '@sammo-ts/logic/actions/turn/actionContextHelpers.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { NationTurnCommandSpec } from './index.js';
export interface VolunteerRecruitArgs {}
@@ -2,13 +2,13 @@ import type {
General,
GeneralTriggerState,
Nation,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
RequirementKey,
StateView,
} from '../../../constraints/types.js';
} from '@sammo-ts/logic/constraints/types.js';
import {
alwaysFail,
beChief,
@@ -19,24 +19,24 @@ import {
reqNationGold,
reqNationRice,
suppliedCity,
} from '../../../constraints/presets.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/presets.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionEffect,
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
} from '@sammo-ts/logic/actions/engine.js';
import {
createGeneralPatchEffect,
createLogEffect,
createNationPatchEffect,
} from '../../engine.js';
import { LogCategory, LogFormat, LogScope } from '../../../logging/types.js';
import type { TurnCommandEnv } from '../commandEnv.js';
} from '@sammo-ts/logic/actions/engine.js';
import { LogCategory, LogFormat, LogScope } from '@sammo-ts/logic/logging/types.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import type { NationTurnCommandSpec } from './index.js';
import { JosaUtil } from '@sammo-ts/common';
import type { ActionContextBuilder } from '../actionContext.js';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
export interface AwardArgs {
isGold: boolean;
@@ -1,4 +1,4 @@
import type { TurnCommandModule, TurnCommandSpecBase } from '../commandModule.js';
import type { TurnCommandModule, TurnCommandSpecBase } from '@sammo-ts/logic/actions/turn/commandModule.js';
export const NATION_TURN_COMMAND_KEYS = [
'휴식',
@@ -1,18 +1,18 @@
import type {
GeneralTriggerState,
} from '../../../domain/entities.js';
} from '@sammo-ts/logic/domain/entities.js';
import type {
Constraint,
ConstraintContext,
} from '../../../constraints/types.js';
import type { GeneralActionDefinition } from '../../definition.js';
} from '@sammo-ts/logic/constraints/types.js';
import type { GeneralActionDefinition } from '@sammo-ts/logic/actions/definition.js';
import type {
GeneralActionOutcome,
GeneralActionResolveContext,
GeneralActionResolver,
} from '../../engine.js';
import type { TurnCommandEnv } from '../commandEnv.js';
import { defaultActionContextBuilder } from '../actionContext.js';
} from '@sammo-ts/logic/actions/engine.js';
import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js';
import { defaultActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import type { NationTurnCommandSpec } from './index.js';
export interface NationRestArgs {}