mirror of
https://github.com/132nd-vWing/tacview-splitter.git
synced 2026-08-26 11:38:37 +02:00
replace purple with violet
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ fn main_inner() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let body = Arc::new(body);
|
let body = Arc::new(body);
|
||||||
let input_filename = Arc::new(input_filename);
|
let input_filename = Arc::new(input_filename);
|
||||||
|
|
||||||
let coalitions = vec![Coalition::Blue, Coalition::Red, Coalition::Purple];
|
let coalitions = vec![Coalition::Blue, Coalition::Red, Coalition::Violet];
|
||||||
|
|
||||||
// clippy wants us to combine both ierators into one. this is not what we want, because then
|
// clippy wants us to combine both ierators into one. this is not what we want, because then
|
||||||
// we would spawn a thread, join it, and only then spawn a new one.
|
// we would spawn a thread, join it, and only then spawn a new one.
|
||||||
|
|||||||
+10
-10
@@ -5,7 +5,7 @@ use std::fmt::Display;
|
|||||||
pub enum Coalition {
|
pub enum Coalition {
|
||||||
Blue,
|
Blue,
|
||||||
Red,
|
Red,
|
||||||
Purple,
|
Violet,
|
||||||
All,
|
All,
|
||||||
Unknown,
|
Unknown,
|
||||||
}
|
}
|
||||||
@@ -17,8 +17,8 @@ impl Coalition {
|
|||||||
Self::Blue
|
Self::Blue
|
||||||
} else if line.contains("Color=Red") {
|
} else if line.contains("Color=Red") {
|
||||||
Self::Red
|
Self::Red
|
||||||
} else if line.contains("Color=Purple") {
|
} else if line.contains("Color=Violet") {
|
||||||
Self::Purple
|
Self::Violet
|
||||||
} else {
|
} else {
|
||||||
Self::Unknown
|
Self::Unknown
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ impl Display for Coalition {
|
|||||||
match self {
|
match self {
|
||||||
Self::Blue => "blue".to_string(),
|
Self::Blue => "blue".to_string(),
|
||||||
Self::Red => "red".to_string(),
|
Self::Red => "red".to_string(),
|
||||||
Self::Purple => "purple".to_string(),
|
Self::Violet => "violet".to_string(),
|
||||||
Self::All => "all".to_string(),
|
Self::All => "all".to_string(),
|
||||||
Self::Unknown => "unknown".to_string(),
|
Self::Unknown => "unknown".to_string(),
|
||||||
}
|
}
|
||||||
@@ -48,20 +48,20 @@ impl Display for Coalition {
|
|||||||
pub struct CoalitionIDs<'a> {
|
pub struct CoalitionIDs<'a> {
|
||||||
pub blue: HashSet<&'a str>,
|
pub blue: HashSet<&'a str>,
|
||||||
pub red: HashSet<&'a str>,
|
pub red: HashSet<&'a str>,
|
||||||
pub purple: HashSet<&'a str>,
|
pub violet: HashSet<&'a str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> CoalitionIDs<'a> {
|
impl<'a> CoalitionIDs<'a> {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
let (blue, red, purple) = (HashSet::new(), HashSet::new(), HashSet::new());
|
let (blue, red, violet) = (HashSet::new(), HashSet::new(), HashSet::new());
|
||||||
Self { blue, red, purple }
|
Self { blue, red, violet }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn insert(&mut self, id: &'a str, coalition: &Coalition) {
|
pub fn insert(&mut self, id: &'a str, coalition: &Coalition) {
|
||||||
match coalition {
|
match coalition {
|
||||||
Coalition::Blue => self.blue.insert(id),
|
Coalition::Blue => self.blue.insert(id),
|
||||||
Coalition::Red => self.red.insert(id),
|
Coalition::Red => self.red.insert(id),
|
||||||
Coalition::Purple => self.purple.insert(id),
|
Coalition::Violet => self.violet.insert(id),
|
||||||
Coalition::All | Coalition::Unknown => false,
|
Coalition::All | Coalition::Unknown => false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -71,8 +71,8 @@ impl<'a> CoalitionIDs<'a> {
|
|||||||
Some(Coalition::Blue)
|
Some(Coalition::Blue)
|
||||||
} else if self.red.contains(id) {
|
} else if self.red.contains(id) {
|
||||||
Some(Coalition::Red)
|
Some(Coalition::Red)
|
||||||
} else if self.purple.contains(id) {
|
} else if self.violet.contains(id) {
|
||||||
Some(Coalition::Purple)
|
Some(Coalition::Violet)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user