Expand description
tf2-enum
Provides enumerated types for models related to the Team Fortress 2 item schema.
Usage
use tf2_enum::{Quality, Paint};
use std::str::FromStr;
assert_eq!(Quality::from_str("Unusual").unwrap(), Quality::Unusual);
assert_eq!(Quality::Unusual as u32, 5);
assert_eq!(Paint::PinkAsHell.to_string(), "Pink as Hell");
Re-exports
pub use num_enum;
Modules
Enums
- Class.
- Craft class.
- Craft material type.
- Grade.
- Item slot.
- Killstreak tier.
- Killstreaker.
- Origin.
- Paint.
repr
values are mapped to the corresponding color. For team paints this is the color for RED team. - Quality.
- Sheen.
- Spell.
- Strange part.
repr
values are mapped to theirkill_eater_score_type
attribute value. - Wear.
Traits
- The
defindex
value for an item attribute. - The
defindex
values for a set of item attributes. - A trait for capturing the number of variants in Enum. This trait can be autoderived by
strum_macros
. - This trait designates that an
Enum
can be iterated over. It can be auto generated usingstrum_macros
on your behalf.