export enum Role {
    NA,
    Merlin,
    Percival,
    ArthurKnight,
    Morgana,
    Assassin,
    Oberon,
    Mordred,
    Minion
}

export const AVALON_EVIL = [
    Role.Morgana,
    Role.Assassin,
    Role.Oberon,
    Role.Mordred,
    Role.Minion
]

export const AVALON_EVIL_KNOWN_TO_MERLIN = [
    Role.Morgana,
    Role.Assassin,
    Role.Oberon,
    Role.Minion
]

export const AVALON_EVIL_KNOWN_TO_EVIL = [
    Role.Morgana,
    Role.Assassin,
    Role.Mordred,
    Role.Minion
]
export const AVALON_KNOWN_TO_PERCIVAL = [
    Role.Morgana,
    Role.Merlin
]

export const AVALON_GOOD = [
    Role.Merlin,
    Role.Percival,
    Role.ArthurKnight
]

export class Player {
    id: string;
    connectionId: string;
    username: string;
    role: Role;
    isLeader: boolean;
    teamVote?: boolean;
    goingToQuest?: boolean;
    questVote?: boolean;
    seq: number;
}

export class QuestInfo {
    seq: number;
    teamSize: number;
    teamMembers: Player[];
    approve: number;
    reject: number;
    success: number;
    failed: number;
    need2Failed: boolean;
}

export enum AvalonStage {
    JoinGame,
    NewGame,
    PickTeammate,
    TeamVote,
    TeamVoteResult,
    QuestVote,
    QuestVoteResult
}

export class GameInfo {
    stage: AvalonStage;
    questInfos: QuestInfo[];
    players: Player[];
    roles: RoleInfo[];
}

export declare type PlayerAction = 'JoinGame' | 'LeaveGame' | 'PickRole' | 'PickLeader' | 'PickTeamMate' | 'VoteTeamMate' | 'VoteQuest' | 'RefreshStage' | 'RefreshAll'

export class RoleInfo {
    enabled: boolean;
    isGood: boolean;
    role: Role;
    name: string;
    images: string;
    description: string;
}


