pub struct PatternMapDef {
pub roles: BTreeMap<String, RolePatterns>,
pub distinct: Vec<Vec<String>>,
pub text: Vec<String>,
}Expand description
A pattern map: each palette role’s patterns on a one-bit target, the groups of roles that must stay distinct, and the roles text is drawn in.
Fields§
§roles: BTreeMap<String, RolePatterns>Each role’s patterns, by the palette’s name for it.
distinct: Vec<Vec<String>>Groups of roles that tell things apart (["team.player", "team.enemy"]): no two of a group may have foregrounds that look
alike.
text: Vec<String>The roles text is drawn in, which should be black on white or white on black: text is never dithered.
Implementations§
Source§impl PatternMapDef
impl PatternMapDef
Sourcepub fn get(&self, role: &str) -> Option<&RolePatterns>
pub fn get(&self, role: &str) -> Option<&RolePatterns>
The patterns of role, if the map has them.
Sourcepub fn from_source(file: &str, source: &str) -> Result<Self, Vec<ContentError>>
pub fn from_source(file: &str, source: &str) -> Result<Self, Vec<ContentError>>
Parses pattern map source, attributing errors to file. Reports
every distinct group of fewer than two roles or with a role twice
in it. A map is checked against its palette by check.
Trait Implementations§
Source§impl AssetKind for PatternMapDef
impl AssetKind for PatternMapDef
Source§impl Clone for PatternMapDef
impl Clone for PatternMapDef
Source§fn clone(&self) -> PatternMapDef
fn clone(&self) -> PatternMapDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PatternMapDef
impl Debug for PatternMapDef
Source§impl Default for PatternMapDef
impl Default for PatternMapDef
Source§fn default() -> PatternMapDef
fn default() -> PatternMapDef
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PatternMapDef
impl<'de> Deserialize<'de> for PatternMapDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PatternMapDef
Source§impl PartialEq for PatternMapDef
impl PartialEq for PatternMapDef
Source§impl Serialize for PatternMapDef
impl Serialize for PatternMapDef
impl StructuralPartialEq for PatternMapDef
Auto Trait Implementations§
impl Freeze for PatternMapDef
impl RefUnwindSafe for PatternMapDef
impl Send for PatternMapDef
impl Sync for PatternMapDef
impl Unpin for PatternMapDef
impl UnsafeUnpin for PatternMapDef
impl UnwindSafe for PatternMapDef
Blanket Implementations§
impl<K> Bakeable for K
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more