一点点摸

This commit is contained in:
shenjack 2024-05-08 00:08:10 +08:00
parent 30ac84a915
commit 25cd8a38d6
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -154,9 +154,24 @@ impl Player {
let weapon: Option<&str>;
if raw_name.contains("@") {
(name, team) = raw_name.split_once("@").unwrap();
// 判定武器
if team.contains("+") {
(team, weapon) = team.split_once("+").unwrap();
} else {
weapon = None;
}
todo!()
} else {
// 没有队伍名, 直接是武器
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) {}