aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: 757fb13b1267b2ec6d68b6c3c5816325a2cf58a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(async_closure)]
#![feature(iterator_try_collect)]
use game::Game;
use redb::Database;
use std::collections::{HashMap, VecDeque};
use tokio::sync::{broadcast, RwLock};

pub mod bot;
pub mod config;
pub mod database;
pub mod game;
pub mod spectate;

pub struct State {
    pub tick: broadcast::Sender<bool>, // true for new game
    pub game: RwLock<Game>,
    pub players: RwLock<HashMap<u32, String>>,
    pub win_history: RwLock<VecDeque<String>>,
    pub chat: broadcast::Sender<(String, String)>,
    pub db: Database,
}