mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-15 06:12:34 -06:00
refactor: move direction & edible into entity submodule
This commit is contained in:
@@ -4,7 +4,7 @@ use std::rc::Rc;
|
||||
use sdl2::render::{Canvas, Texture};
|
||||
use sdl2::video::Window;
|
||||
|
||||
use crate::direction::Direction;
|
||||
use crate::entity::direction::Direction;
|
||||
use crate::entity::ghost::{Ghost, GhostMode, GhostType};
|
||||
use crate::entity::pacman::Pacman;
|
||||
use crate::entity::{Entity, Moving, Renderable, StaticEntity};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Edible entity for Pac-Man: pellets, power pellets, and fruits.
|
||||
use crate::constants::{FruitType, MapTile, BOARD_HEIGHT, BOARD_WIDTH};
|
||||
use crate::direction::Direction;
|
||||
use crate::entity::direction::Direction;
|
||||
use crate::entity::{Entity, Renderable, StaticEntity};
|
||||
use crate::map::Map;
|
||||
use crate::texture::atlas::AtlasTexture;
|
||||
@@ -3,7 +3,7 @@ use rand::Rng;
|
||||
use rand::SeedableRng;
|
||||
|
||||
use crate::constants::{MapTile, BOARD_WIDTH};
|
||||
use crate::direction::Direction;
|
||||
use crate::entity::direction::Direction;
|
||||
use crate::entity::pacman::Pacman;
|
||||
use crate::entity::{Entity, MovableEntity, Moving, Renderable};
|
||||
use crate::map::Map;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
pub mod blinky;
|
||||
pub mod direction;
|
||||
pub mod edible;
|
||||
pub mod ghost;
|
||||
pub mod pacman;
|
||||
|
||||
use crate::{
|
||||
constants::{MapTile, BOARD_OFFSET, BOARD_WIDTH, CELL_SIZE},
|
||||
direction::Direction,
|
||||
entity::direction::Direction,
|
||||
map::Map,
|
||||
modulation::SimpleTickModulator,
|
||||
};
|
||||
|
||||
@@ -8,8 +8,7 @@ use sdl2::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
direction::Direction,
|
||||
entity::{Entity, MovableEntity, Moving, Renderable, StaticEntity},
|
||||
entity::{direction::Direction, Entity, MovableEntity, Moving, Renderable, StaticEntity},
|
||||
map::Map,
|
||||
modulation::{SimpleTickModulator, TickModulator},
|
||||
texture::animated::AnimatedAtlasTexture,
|
||||
|
||||
@@ -19,9 +19,9 @@ use crate::asset::{get_asset_bytes, Asset};
|
||||
use crate::audio::Audio;
|
||||
use crate::constants::RAW_BOARD;
|
||||
use crate::debug::{DebugMode, DebugRenderer};
|
||||
use crate::direction::Direction;
|
||||
use crate::edible::{reconstruct_edibles, Edible, EdibleKind};
|
||||
use crate::entity::blinky::Blinky;
|
||||
use crate::entity::direction::Direction;
|
||||
use crate::entity::edible::{reconstruct_edibles, Edible, EdibleKind};
|
||||
use crate::entity::pacman::Pacman;
|
||||
use crate::entity::Renderable;
|
||||
use crate::map::Map;
|
||||
|
||||
@@ -56,8 +56,6 @@ mod asset;
|
||||
mod audio;
|
||||
mod constants;
|
||||
mod debug;
|
||||
mod direction;
|
||||
mod edible;
|
||||
#[cfg(target_os = "emscripten")]
|
||||
mod emscripten;
|
||||
mod entity;
|
||||
|
||||
@@ -4,7 +4,7 @@ use sdl2::{
|
||||
video::Window,
|
||||
};
|
||||
|
||||
use crate::direction::Direction;
|
||||
use crate::entity::direction::Direction;
|
||||
use crate::texture::atlas::AtlasTexture;
|
||||
use crate::texture::FrameDrawn;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use sdl2::{
|
||||
video::Window,
|
||||
};
|
||||
|
||||
use crate::{direction::Direction, texture::FrameDrawn};
|
||||
use crate::{entity::direction::Direction, texture::FrameDrawn};
|
||||
|
||||
/// A texture atlas abstraction for static (non-animated) rendering.
|
||||
pub struct AtlasTexture<'a> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use sdl2::{render::Canvas, video::Window};
|
||||
|
||||
use crate::direction::Direction;
|
||||
use crate::entity::direction::Direction;
|
||||
|
||||
/// Trait for drawable atlas-based textures
|
||||
pub trait FrameDrawn {
|
||||
|
||||
Reference in New Issue
Block a user