town tweaks
This commit is contained in:
parent
3dab5202f8
commit
6d6b84ae6a
8 changed files with 86 additions and 30 deletions
|
|
@ -24,6 +24,7 @@ pub struct Map {
|
|||
pub additional_fg_offset: rltk::RGB,
|
||||
pub blocked: Vec<bool>,
|
||||
pub id: i32,
|
||||
pub name: String,
|
||||
pub difficulty: i32,
|
||||
pub bloodstains: HashSet<usize>,
|
||||
pub view_blocked: HashSet<usize>,
|
||||
|
|
@ -38,7 +39,7 @@ impl Map {
|
|||
(y as usize) * (self.width as usize) + (x as usize)
|
||||
}
|
||||
|
||||
pub fn new(new_id: i32, width: i32, height: i32, difficulty: i32) -> Map {
|
||||
pub fn new<S: ToString>(new_id: i32, width: i32, height: i32, difficulty: i32, name: S) -> Map {
|
||||
let map_tile_count = (width * height) as usize;
|
||||
let mut map = Map {
|
||||
tiles: vec![TileType::Wall; map_tile_count],
|
||||
|
|
@ -52,6 +53,7 @@ impl Map {
|
|||
additional_fg_offset: rltk::RGB::from_u8(HALF_OFFSET, HALF_OFFSET, HALF_OFFSET),
|
||||
blocked: vec![false; map_tile_count],
|
||||
id: new_id,
|
||||
name: name.to_string(),
|
||||
difficulty: difficulty,
|
||||
bloodstains: HashSet::new(),
|
||||
view_blocked: HashSet::new(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue