一点点摸
This commit is contained in:
parent
30ac84a915
commit
25cd8a38d6
@ -154,9 +154,24 @@ impl Player {
|
|||||||
let weapon: Option<&str>;
|
let weapon: Option<&str>;
|
||||||
if raw_name.contains("@") {
|
if raw_name.contains("@") {
|
||||||
(name, team) = raw_name.split_once("@").unwrap();
|
(name, team) = raw_name.split_once("@").unwrap();
|
||||||
|
// 判定武器
|
||||||
|
if team.contains("+") {
|
||||||
|
(team, weapon) = team.split_once("+").unwrap();
|
||||||
|
} else {
|
||||||
|
weapon = None;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
todo!()
|
// 没有队伍名, 直接是武器
|
||||||
|
if team.contains("+") {
|
||||||
|
(name, weapon) = raw_name.split_once("+").unwrap();
|
||||||
|
team = name;
|
||||||
|
} else {
|
||||||
|
name = raw_name.as_str();
|
||||||
|
team = name;
|
||||||
|
weapon = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Player::new(name.to_string(), team.to_string(), weapon.map(|s| s.to_string()))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_player(&mut self) {}
|
pub fn update_player(&mut self) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user