import { Player, PlayerPhantom } from "./Player"
import { Action } from "./Action"
import { CourtObject } from "./CourtObjects"

export interface TacticInfo {
    readonly id: number
    readonly name: string
    readonly courtType: CourtType
    readonly rootStepNode: StepInfoNode
}

export interface TacticStep {
    readonly stepId: number
    readonly content: StepContent
}

export interface StepContent {
    readonly components: TacticComponent[]
}

export interface StepInfoNode {
    readonly id: number
    readonly children: StepInfoNode[]
}

export type TacticComponent = Player | CourtObject | PlayerPhantom
export type ComponentId = string
export type CourtType = "PLAIN" | "HALF"

export interface Component<T, Positioning> {
    /**
     * The component's type
     */
    readonly type: T
    /**
     * The component's identifier
     */
    readonly id: ComponentId

    readonly pos: Positioning

    readonly actions: Action[]
}

export interface Frozable {
    readonly frozen: boolean
}
