Refactor map

This commit is contained in:
2022-01-29 20:21:13 +01:00
parent 0af23af3d3
commit fa71410453
7 changed files with 89 additions and 53 deletions

View File

@@ -1,7 +1,6 @@
use std::cmp::{max, min};
use std::collections::HashSet;
use rltk::{Algorithm2D, BaseMap, FontCharType, Point, RandomNumberGenerator, Rltk, RGB};
use rltk::{Algorithm2D, BaseMap, FontCharType, Point, RGB, Rltk};
use serde::{Deserialize, Serialize};
use specs::prelude::*;
@@ -22,7 +21,6 @@ pub const MAX_MONSTER: i32 = 4;
#[derive(Default, Serialize, Deserialize, Clone)]
pub struct Map {
pub tiles: Vec<TileType>,
pub rooms: Vec<Rect>,
pub width: i32,
pub height: i32,
pub revealed_tiles: Vec<bool>,
@@ -64,7 +62,6 @@ impl Map {
pub fn new(new_depth: i32) -> Map {
Map {
tiles: vec![TileType::Wall; MAP_COUNT],
rooms: Vec::new(),
width: MAP_WIDTH as i32,
height: MAP_HEIGHT as i32,
revealed_tiles: vec![false; MAP_COUNT],