From fee36f158b949bea9db928339d7bd6136d432e56 Mon Sep 17 00:00:00 2001 From: Alex Bethel Date: Mon, 10 Jan 2022 19:32:43 -0600 Subject: [PATCH] Tear out dungeon branch infrastructure It's all unused at the moment, and I'll probably re-build it entirely differently later. --- src/game.rs | 23 +---------------------- src/main.rs | 5 ++--- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/game.rs b/src/game.rs index c436d52..57faedc 100644 --- a/src/game.rs +++ b/src/game.rs @@ -4,24 +4,6 @@ use pancurses::Window; use crate::rooms; -/// A dungeon root. -pub struct Dungeon { - main_branch: DungeonBranch, -} - -/// A single branch of a dungeon, which has a number of levels and -/// which can potentially contain passages to other branches. -pub struct DungeonBranch { - config: BranchConfig, - levels: Vec, -} - -/// The parameters that characterize a particular dungeon branch. -/// Currently a unit struct because there's only one type of branch, -/// but will later include e.g. architectural styles, good vs. evil & -/// lawful vs. chaotic weights, etc. -pub struct BranchConfig; - /// The size of a dungeon level, in tiles. pub const LEVEL_SIZE: (usize, usize) = (80, 24); @@ -51,10 +33,7 @@ pub enum DungeonTile { impl DungeonLevel { /// Creates a new level in a branch that has the given /// configuration. - pub fn new(_cfg: &BranchConfig) -> Self { - // Self { - // tiles: rooms::generate_level(100, &mut rand::thread_rng()), - // } + pub fn new() -> Self { rooms::generate_level(100, &mut rand::thread_rng(), 1, 1) } diff --git a/src/main.rs b/src/main.rs index e290ec1..4732cbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use std::process::exit; use components::{register_all, CharRender, MobAction, Mobile, Player, Position, TurnTaker}; -use game::{BranchConfig, DungeonLevel}; +use game::DungeonLevel; use pancurses::{endwin, initscr, noecho, Window}; use player::player_turn; @@ -20,8 +20,7 @@ fn main() { register_all(&mut world); - let cfg = BranchConfig; - let level = DungeonLevel::new(&cfg); + let level = DungeonLevel::new(); let spawn_pos = level.upstairs()[0]; world.insert(level);