~muirrum/hakkardrs

018d4b6ad5f662bc5364ec52031b8280375d6449 — Cara Salter 6 months ago 21841e9 master
Scaffold out room trait
2 files changed, 17 insertions(+), 0 deletions(-)

M src/main.rs
A src/rooms.rs
M src/main.rs => src/main.rs +1 -0
@@ 5,6 5,7 @@ use tokio::net::{tcp, TcpListener, TcpStream};

mod game;
mod player;
mod rooms;
use game::Game;
use player::Player;


A src/rooms.rs => src/rooms.rs +16 -0
@@ 0,0 1,16 @@
/// Contains traits for Levels to implement and the function call that registers all of them
use crate::player::Player;
use crate::game::Game;


pub trait Room {
    pub async fn on_enter(&self, player: &Player);

    pub async fn on_tick(&self, game: &Game);
}


pub fn register_rooms(game: &mut Game) {
    /// Register all rooms
    /// Should call the area registration functions
}
\ No newline at end of file