|
|
@ -6,7 +6,7 @@ import { ComponentId, StepContent, TacticComponent } from "../model/tactic/Tacti
|
|
|
|
|
|
|
|
|
|
|
|
import { overlaps } from "../geo/Box"
|
|
|
|
import { overlaps } from "../geo/Box"
|
|
|
|
import { RackedCourtObject, RackedPlayer } from "./RackedItems"
|
|
|
|
import { RackedCourtObject, RackedPlayer } from "./RackedItems"
|
|
|
|
import { getComponent, getOrigin, getPrecomputedPosition, tryGetComponent } from "./PlayerDomains"
|
|
|
|
import { getComponent, getOrigin, getPrecomputedPosition, removePlayer, tryGetComponent } from "./PlayerDomains"
|
|
|
|
import { Action, ActionKind } from "../model/tactic/Action.ts"
|
|
|
|
import { Action, ActionKind } from "../model/tactic/Action.ts"
|
|
|
|
import { spreadNewStateFromOriginStateChange } from "./ActionsDomains.ts"
|
|
|
|
import { spreadNewStateFromOriginStateChange } from "./ActionsDomains.ts"
|
|
|
|
|
|
|
|
|
|
|
@ -437,14 +437,12 @@ export function drainTerminalStateOnChildContent(
|
|
|
|
|
|
|
|
|
|
|
|
const initialChildCompsCount = childContent.components.length
|
|
|
|
const initialChildCompsCount = childContent.components.length
|
|
|
|
|
|
|
|
|
|
|
|
//filter out all frozen components that are not present on the parent's terminal state anymore
|
|
|
|
for (const component of childContent.components) {
|
|
|
|
childContent = {
|
|
|
|
if (component.type !== "phantom" && component.frozen && !tryGetComponent(component.id, parentTerminalState.components)) {
|
|
|
|
components: childContent.components.filter(
|
|
|
|
if (component.type === "player")
|
|
|
|
(comp) =>
|
|
|
|
childContent = removePlayer(component, childContent)
|
|
|
|
comp.type === "phantom" ||
|
|
|
|
else childContent = {...childContent, components: childContent.components.filter(c => c.id !== component.id)}
|
|
|
|
!comp.frozen ||
|
|
|
|
}
|
|
|
|
tryGetComponent(comp.id, parentTerminalState.components),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gotUpdated ||= childContent.components.length !== initialChildCompsCount
|
|
|
|
gotUpdated ||= childContent.components.length !== initialChildCompsCount
|
|
|
|