import {QueryType, Transactable} from "./database.js"
import {Snowflake} from "discord-api-types/globals.js"
import {Pronouns} from "./pronouns.js"

export interface CharacterCreationState {
    name: string | null
    title: string | null
    profile: string | null
    gender: string | null
    pronouns: Pronouns | null
    difficulty: Difficulty | null
    preference: Preference | null
    type1: BattleType | null,
    type2: BattleType | null,
    baseConfidence: number | null,
    baseHealth: number | null,
    baseStamina: number | null,
    baseBrawn: number | null,
    baseDurability: number | null,
    baseIntensity: number | null,
    baseResilience: number | null,
    baseSpeed: number | null,
}

export interface CharacterCreationInput {
    name?: string
    title?: string
    profile?: string
    gender?: string
    pronouns?: string
    difficultyName?: string
    preferenceName?: string
    type1Name?: string
    type2Name?: string
    baseConfidence?: number
    baseHealth?: number
    baseStamina?: number
    baseBrawn?: number
    baseDurability?: number
    baseIntensity?: number
    baseResilience?: number
    baseSpeed?: number
}

export interface CharacterCreationTable {
    startOrContinueCreatingCharacter(snowflake: Snowflake,
                                     input: CharacterCreationInput): Promise<CharacterCreationState>
}

export class CharacterCreationTableImpl implements CharacterCreationTable {
    private readonly _query: QueryType
    private readonly _transactable: Transactable

    constructor({query, transactable}: { query: QueryType, transactable: Transactable }) {
        this._query = query
        this._transactable = transactable
    }

    async startOrContinueCreatingCharacter(
        owner: Snowflake,
        input: CharacterCreationInput): Promise<CharacterCreationState> {

    }
}