mana_symbols/
lib.rs

1//! # Mana Symbols
2//! This crate models [mana costs][mw:mc] from [Magic the Gathering][wp:mtg]
3//! cards. It can parse text representations of mana (e.g. `{5}{U}{U/B}`), sort
4//! mana costs and calculate [mana values][mw:mv].
5//!
6//! ## Supported mana
7//!
8//! The types of mana supported by this library (as [`Mana`]) are:
9//! - [Generic mana][mw:gm]
10//! - [Colorless mana][mw:clm]
11//! - [Colored][mw:c] mana (including [phyrexian][mw:pm])
12//! - [Hybrid mana][mw:hm] (including generic, colorless and phyrexian)
13//! - [Snow mana][mw:sc]
14//!
15//! [mw:mc]:  https://mtg.wiki/page/Mana_cost
16//! [mw:mv]:  https://mtg.wiki/page/Mana_value
17//! [mw:gm]:  https://mtg.wiki/page/Generic_mana
18//! [mw:clm]: https://mtg.wiki/page/Colorless#Colorless_mana
19//! [mw:pm]:  https://mtg.wiki/page/Phyrexian_mana
20//! [mw:c]:   https://mtg.wiki/page/Color
21//! [mw:hm]:  https://mtg.wiki/page/Hybrid_mana
22//! [mw:sc]:  https://mtg.wiki/page/Snow#Snow_costs
23//!
24//! [wp:mtg]:  https://en.wikipedia.org/wiki/Magic:_The_Gathering
25//! [wp:wotc]: https://en.wikipedia.org/wiki/Wizards_of_the_Coast
26//!
27//! [reddit:user]: https://www.reddit.com/user/Mean-Government1436
28//! [reddit:post]: https://www.reddit.com/r/custommagic/comments/1nhtr3w/guide_for_formatting_mana_costs/
29
30mod color;
31mod color_set;
32mod generic_mana;
33mod mana;
34mod manas;
35pub(crate) mod parsing;
36mod single_mana;
37mod split_mana;
38mod svg_config;
39mod symbols;
40
41pub use color::Color;
42pub(crate) use generic_mana::GenericMana;
43pub use mana::Mana;
44pub use manas::Manas;
45pub use parsing::Case;
46pub(crate) use single_mana::SingleMana;
47pub(crate) use split_mana::SplitMana;
48pub use svg_config::SVGConfig;
49
50/// Each SVG is defined using coordinates in [0, 32.0]^2
51const SVG_WIDTH: f64 = 32.0;