Move map and sound stuff to resources module
This commit is contained in:
parent
a8500b96d2
commit
6ce6470236
7 changed files with 23 additions and 14 deletions
|
@ -2,11 +2,8 @@
|
|||
|
||||
pub mod components;
|
||||
pub mod constants;
|
||||
mod map;
|
||||
pub mod resources;
|
||||
mod sidebar;
|
||||
mod sound;
|
||||
mod sound_effects;
|
||||
mod state;
|
||||
pub mod systems;
|
||||
pub mod vga_color;
|
||||
|
@ -16,10 +13,8 @@ use components::{
|
|||
monster::{color_for_kind, glyphs_for_kind, ticks_for_kind, MonsterKind},
|
||||
Monster, Player, Position, Renderable,
|
||||
};
|
||||
use map::{Map, TileType};
|
||||
use resources::{Clock, LevelNumber, ShowDebugInfo, Stats};
|
||||
use sound::SoundSystem;
|
||||
use sound_effects::SoundEffects;
|
||||
use resources::map::TileType;
|
||||
use resources::{Clock, LevelNumber, Map, ShowDebugInfo, SoundEffects, SoundSystem, Stats};
|
||||
use specs::prelude::*;
|
||||
use state::State;
|
||||
use std::time::Instant;
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
pub mod map;
|
||||
pub mod sound_effects;
|
||||
pub mod sound_system;
|
||||
|
||||
pub use map::Map;
|
||||
pub use sound_effects::SoundEffects;
|
||||
pub use sound_system::SoundSystem;
|
||||
|
||||
use crate::constants::CLOCK_PERIOD;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@ use std::{array, iter, time::Duration};
|
|||
|
||||
use bracket_lib::random::RandomNumberGenerator;
|
||||
|
||||
use crate::sound::{Sound, SoundEffect, SoundEffectSamples, SoundSystem, SoundType};
|
||||
use crate::resources::sound_system::{
|
||||
Sound, SoundEffect, SoundEffectSamples, SoundSystem, SoundType,
|
||||
};
|
||||
|
||||
pub struct SoundEffects {
|
||||
pub startup: SoundEffectSamples,
|
|
@ -34,6 +34,12 @@ pub struct SoundSystem {
|
|||
_stream: Stream,
|
||||
}
|
||||
|
||||
impl Default for SoundSystem {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl SoundSystem {
|
||||
pub fn new() -> Self {
|
||||
let host = cpal::default_host();
|
|
@ -2,10 +2,8 @@ use std::time::{Duration, Instant};
|
|||
|
||||
use crate::components::monster::damage_for_kind;
|
||||
use crate::components::{Monster, Player, Position, Renderable};
|
||||
use crate::map::{Map, TileType};
|
||||
use crate::resources::{Clock, ShowDebugInfo, Stats};
|
||||
use crate::sound::SoundSystem;
|
||||
use crate::sound_effects::SoundEffects;
|
||||
use crate::resources::map::TileType;
|
||||
use crate::resources::{Clock, Map, ShowDebugInfo, SoundEffects, SoundSystem, Stats};
|
||||
use crate::systems::MonsterMotion;
|
||||
use crate::{constants::*, sidebar};
|
||||
use bracket_lib::prelude::*;
|
||||
|
|
|
@ -3,8 +3,8 @@ use crate::{
|
|||
monster::{self, damage_for_kind, ticks_for_kind},
|
||||
Monster, Position, Renderable,
|
||||
},
|
||||
map::{Map, TileType},
|
||||
resources::{Clock, Stats},
|
||||
resources::map::TileType,
|
||||
resources::{Clock, Map, Stats},
|
||||
};
|
||||
use bracket_lib::{prelude::*, random::RandomNumberGenerator};
|
||||
use specs::prelude::*;
|
||||
|
|
Loading…
Add table
Reference in a new issue