fg_notation/lib.rs
1//! A crate/binary to convert between forms of fighting game notation,
2//! currently [numpad](https://glossary.infil.net/?t=Numpad%20Notation)
3//! & [abbreviated](https://glossary.infil.net/?t=Notation) notation,
4//! using the corresponding modules.
5//!
6//! The modules provide types for full moves & their components
7//! which have [`From`] impls for their counterparts in the other module.
8//!
9//! # Example
10//!
11//! ```
12//! # use fg_notation::{abbreviated, numpad, CreationError};
13//!
14//! let numpad_move = numpad::Move::new("236H")?;
15//! let abbreviated_move = abbreviated::Move::new("qcf H")?;
16//!
17//! assert_eq!(numpad::Move::from(abbreviated_move.clone()), numpad_move);
18//! assert_eq!(abbreviated::Move::from(numpad_move), abbreviated_move);
19//!
20//! # Result::<(), CreationError>::Ok(())
21//! ```
22
23pub mod abbreviated;
24pub mod numpad;
25
26use thiserror::Error;
27
28#[derive(Debug, Error)]
29pub enum CreationError {
30 #[error("Invalid motion input.")]
31 InvalidMotion,
32 #[error("Invalid button.")]
33 InvalidButton,
34 #[error("Invalid modifier.")]
35 InvalidModifier,
36}