Room Creating: Place Kitchen Furniture #11

Merged
msrd0 merged 19 commits from room-creation-placing-furniture into main 2024-07-07 11:54:43 +00:00
4 changed files with 4 additions and 13 deletions
Showing only changes of commit fd4f67336b - Show all commits

View file

@ -4,7 +4,6 @@ mod player;
mod room; mod room;
use self::{grid::Grid, player::Player, room::Room}; use self::{grid::Grid, player::Player, room::Room};
use super::Activity;
use crate::State; use crate::State;
use comfy::{error, EngineContext}; use comfy::{error, EngineContext};

View file

@ -27,7 +27,7 @@ struct Tile {
#[derive(Debug)] #[derive(Debug)]
pub struct Room { pub struct Room {
room_type: RoomType, _room_type: RoomType,
pub size: (u8, u8), //(width, height) pub size: (u8, u8), //(width, height)
pub grid: Grid, pub grid: Grid,
furnitures: Vec<Tile> furnitures: Vec<Tile>
@ -54,7 +54,7 @@ impl Room {
let furnitures = Self::random_room_furniture(&room_type, size, ctx); let furnitures = Self::random_room_furniture(&room_type, size, ctx);
Room { Room {
room_type, _room_type: room_type,
size, size,
grid: Self::create_grid(size.0, size.1), grid: Self::create_grid(size.0, size.1),
furnitures furnitures
@ -80,7 +80,6 @@ impl Room {
let mut furnitures = Vec::new(); let mut furnitures = Vec::new();
let mut empty_spots: IndexSet<u8> = (0 .. width).collect(); let mut empty_spots: IndexSet<u8> = (0 .. width).collect();
let mut assets_used: HashSet<&'static str> = HashSet::new();
fn random_empty_spot<T>(empty_spots: &mut IndexSet<T>) -> Option<T> { fn random_empty_spot<T>(empty_spots: &mut IndexSet<T>) -> Option<T> {
if empty_spots.is_empty() { if empty_spots.is_empty() {

View file

@ -1,11 +1,4 @@
use crate::{ use crate::{activities::Activity, game::ZLayer, State};
activities::{
house::{self, HouseState},
Activity
},
game::ZLayer,
State
};
use comfy::{ use comfy::{
draw_circle, draw_rect_outline, draw_sprite, error, info, is_key_down, draw_circle, draw_rect_outline, draw_sprite, error, info, is_key_down,
main_camera_mut, EngineContext, IVec2, KeyCode, Vec2, RED, WHITE main_camera_mut, EngineContext, IVec2, KeyCode, Vec2, RED, WHITE

View file

@ -86,7 +86,7 @@ impl Sub<i32> for ZLayer {
} }
} }
pub fn setup(state: &mut State, ctx: &mut EngineContext<'_>) { pub fn setup(_state: &mut State, ctx: &mut EngineContext<'_>) {
Assets::load(ctx); Assets::load(ctx);
} }