mirror of
https://github.com/ayywrk/hardfight.git
synced 2024-11-16 20:56:39 +00:00
Added ,stop cmd
This commit is contained in:
parent
48957df3cd
commit
f88e947391
12
src/main.rs
12
src/main.rs
@ -234,7 +234,10 @@ async fn main() -> std::io::Result<()> {
|
|||||||
.add_system("h", show_help)
|
.add_system("h", show_help)
|
||||||
.await
|
.await
|
||||||
.add_system("s", show_status)
|
.add_system("s", show_status)
|
||||||
.await;
|
.await
|
||||||
|
.add_system("stop", stop)
|
||||||
|
.await
|
||||||
|
;
|
||||||
|
|
||||||
irc.run().await?;
|
irc.run().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -532,6 +535,7 @@ fn show_help() -> impl IntoResponse {
|
|||||||
",f <nick> ... vs <nick> ... | team battle",
|
",f <nick> ... vs <nick> ... | team battle",
|
||||||
",f <nick> <nick> <nick> ... | free for all",
|
",f <nick> <nick> <nick> ... | free for all",
|
||||||
",s | show the current fight status",
|
",s | show the current fight status",
|
||||||
|
",stop | stop the current fight",
|
||||||
",hof | hall of fame",
|
",hof | hall of fame",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -544,3 +548,9 @@ fn show_status(fight: Res<Fight>) -> impl IntoResponse {
|
|||||||
|
|
||||||
format!("{} fighters remaining", fight.fighters.len())
|
format!("{} fighters remaining", fight.fighters.len())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn stop(mut fight: ResMut<Fight>) {
|
||||||
|
fight.fighters = vec![];
|
||||||
|
fight.channel = "".to_owned();
|
||||||
|
fight.status = FightStatus::Idle;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user