use self::{map::Map, tee::Tees}; use crate::client::{helper::get_map_path, ClientMesgOut}; use std::fs::File; pub mod helper; pub mod map; pub mod tee; pub use gamenet::enums; pub struct World { pub map: Map, pub tees: Tees, } impl World { pub fn new() -> Self { Self { map: Map::empty(), tees: Tees::new(), } } pub fn update(&mut self, m: &ClientMesgOut) { self.tees.update(m); match m { ClientMesgOut::MapChange { name, crc } => { let file = File::open(get_map_path(name.as_str(), *crc)).unwrap(); self.map = Map::load(file, name.as_str(), *crc).unwrap(); } _ => (), } } }