feat: huge refactor to data acessing, some API changes
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
use std::net::SocketAddr;
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
use crate::server::Server;
|
||||
@@ -9,15 +7,14 @@ pub use round_robin::RoundRobin;
|
||||
|
||||
#[async_trait]
|
||||
pub trait Tournament {
|
||||
fn new(ready_players: &[SocketAddr]) -> Self
|
||||
fn new(ready_players: &[String]) -> Self
|
||||
where
|
||||
Self: Sized;
|
||||
async fn next(&mut self, server: &Server);
|
||||
async fn start(&mut self, server: &Server);
|
||||
async fn cancel(&mut self, server: &Server);
|
||||
fn inform_winner(&mut self, winner: SocketAddr, is_tie: bool);
|
||||
fn inform_reconnect(&mut self, old_addr: SocketAddr, new_addr: SocketAddr);
|
||||
fn contains_player(&self, addr: SocketAddr) -> bool;
|
||||
fn inform_winner(&mut self, winner: String, is_tie: bool);
|
||||
fn contains_player(&self, username: String) -> bool;
|
||||
fn is_completed(&self) -> bool;
|
||||
fn get_type(&self) -> String;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user