use rltk::prelude::*;

pub fn letter_to_option(key: VirtualKeyCode, shift: bool) -> i32 {
    if shift {
        match key {
            VirtualKeyCode::A => 26,
            VirtualKeyCode::B => 27,
            VirtualKeyCode::C => 28,
            VirtualKeyCode::D => 29,
            VirtualKeyCode::E => 30,
            VirtualKeyCode::F => 31,
            VirtualKeyCode::G => 32,
            VirtualKeyCode::H => 33,
            VirtualKeyCode::I => 34,
            VirtualKeyCode::J => 35,
            VirtualKeyCode::K => 36,
            VirtualKeyCode::L => 37,
            VirtualKeyCode::M => 38,
            VirtualKeyCode::N => 39,
            VirtualKeyCode::O => 40,
            VirtualKeyCode::P => 41,
            VirtualKeyCode::Q => 42,
            VirtualKeyCode::R => 43,
            VirtualKeyCode::S => 44,
            VirtualKeyCode::T => 45,
            VirtualKeyCode::U => 46,
            VirtualKeyCode::V => 47,
            VirtualKeyCode::W => 48,
            VirtualKeyCode::X => 49,
            VirtualKeyCode::Y => 50,
            VirtualKeyCode::Z => 51,
            _ => -1,
        }
    } else {
        match key {
            VirtualKeyCode::A => 0,
            VirtualKeyCode::B => 1,
            VirtualKeyCode::C => 2,
            VirtualKeyCode::D => 3,
            VirtualKeyCode::E => 4,
            VirtualKeyCode::F => 5,
            VirtualKeyCode::G => 6,
            VirtualKeyCode::H => 7,
            VirtualKeyCode::I => 8,
            VirtualKeyCode::J => 9,
            VirtualKeyCode::K => 10,
            VirtualKeyCode::L => 11,
            VirtualKeyCode::M => 12,
            VirtualKeyCode::N => 13,
            VirtualKeyCode::O => 14,
            VirtualKeyCode::P => 15,
            VirtualKeyCode::Q => 16,
            VirtualKeyCode::R => 17,
            VirtualKeyCode::S => 18,
            VirtualKeyCode::T => 19,
            VirtualKeyCode::U => 20,
            VirtualKeyCode::V => 21,
            VirtualKeyCode::W => 22,
            VirtualKeyCode::X => 23,
            VirtualKeyCode::Y => 24,
            VirtualKeyCode::Z => 25,
            _ => -1,
        }
    }
}
