Browse Source

Clean up main imports a bit

Getty Ritter 4 years ago
parent
commit
adf5a4cc82
1 changed files with 8 additions and 8 deletions
  1. 8 8
      chapter-07-damage/src/main.rs

+ 8 - 8
chapter-07-damage/src/main.rs

@@ -1,20 +1,20 @@
-extern crate rltk;
-use rltk::{Console, GameState, Point, Rltk, RGB};
-extern crate specs;
-use specs::prelude::*;
 #[macro_use]
 extern crate specs_derive;
+
+
 mod components;
 mod map;
 mod player;
-use player::*;
 mod rect;
 mod systems;
 
 pub use components::*;
-pub use map::*;
+pub use map::Map;
 pub use rect::Rect;
 
+use rltk::{Console, GameState, Point, Rltk, RGB};
+use specs::prelude::*;
+
 rltk::add_wasm_support!();
 
 #[derive(PartialEq, Copy, Clone)]
@@ -51,7 +51,7 @@ impl GameState for State {
                 newrunstate = RunState::AwaitingInput;
             }
             RunState::AwaitingInput => {
-                newrunstate = player_input(self, ctx);
+                newrunstate = player::player_input(self, ctx);
             }
             RunState::PlayerTurn => {
                 self.run_systems();
@@ -67,7 +67,7 @@ impl GameState for State {
         *self.ecs.write_resource() = newrunstate;
         systems::CleanupDead.run_now(&self.ecs);
 
-        draw_map(&self.ecs, ctx);
+        map::draw_map(&self.ecs, ctx);
         systems::DrawRenderables { ctx }.run_now(&self.ecs);
     }
 }