#![allow(dead_code)]
#![allow(long_running_const_eval)]
#![allow(unused_imports)]

use crate::character::Character::{self, *};
use crate::condition::Condition::{self, *};
use crate::entity::Entity;
use crate::item::Item::{self, *};
use crate::location::Location::{self, *};
use crate::save_point::SavePoint::{self, *};
use crate::script::Token::{self, *};
use crate::script::script;
use crate::snippet::Snippet::{self, *};
use crate::sound::Sound::{self, *};
use crate::style::Style::{self, *};

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[repr(u32)]
pub enum Label {
    Label156816,
    Label15681E,
}

use self::Label::*;

const fn find_label(script: &'static [Token<Label>], label: Label) -> usize {
    let mut i = 0;
    while i < script.len() {
        match script[i] {
            Token::Label(l) if l as u8 == label as u8 => return i,
            _ => i += 1,
        };
    }
    unreachable!();
}

pub fn dialog_for_label(index: usize) -> &'static [Token<'static, Label>] {
    &SCRIPTS[INDEXED[index]..]
}

pub fn dialog(index: usize) -> &'static [Token<'static, Label>] {
    &SCRIPTS[INDEXED[index]..]
}

const SCRIPTS: &[Token<Label>] = script![

Label(Label156816)
    "Asha" End

Label(Label15681E)
    "Pepelogoo" End
    ];

pub const INDEXED: &[usize] = &[
    find_label(SCRIPTS, Label156816),
    find_label(SCRIPTS, Label15681E),
];
