misc(refactor): moved tournament to seperate module

This commit is contained in:
2025-12-30 21:39:43 -05:00
Unverified
parent 3afe1d59cb
commit b5d71051a6
5 changed files with 359 additions and 342 deletions

17
src/tournaments/mod.rs Normal file
View File

@@ -0,0 +1,17 @@
use std::net::SocketAddr;
use async_trait::async_trait;
use crate::{*};
pub mod round_robin;
pub use round_robin::RoundRobin;
#[async_trait]
pub trait Tournament {
fn new(ready_players: &[SocketAddr]) -> Self where Self: Sized;
async fn next(&mut self, clients: &Clients, matches: &Matches, observers: &Observers);
async fn start(&mut self, clients: &Clients, matches: &Matches);
async fn cancel(&mut self, clients: &Clients, matches: &Matches, observers: &Observers);
fn is_completed(&self) -> bool;
}