refactor: split magic_numbers into per-module files
Extracted all doc-commented magic numbers into module-local magic_numbers.rs
files, co-located with the module that owns them. No logic changes.
- entities/shared_systems/magic_numbers: pathfinding + dig constants
- world/generation/terrain/magic_numbers: terrain + cave constants
- world/generation/forestry/magic_numbers: tree constants
- world/tiles/magic_numbers: A*, benchmark, memory constants
- entities/item/magic_numbers: item sprite z-offset
- Removed src/magic_numbers.rs (central file deleted)
Constants imported as `crate::{module}::magic_numbers::*` from each
consumer. src/constants.rs retains only structural constants (PIXEL_RATIO,
TILE_SIZE, SEED, pathfinding tier thresholds).
This commit is contained in:
@@ -35,6 +35,7 @@ use super::chunk_data::ChunkData;
|
||||
use crate::constants::ITILE_SIZE;
|
||||
use crate::entities::item::drop_table::DropTable;
|
||||
use crate::world::chunks::{world_to_chunk, CHUNK_SIZE, Z_ABOVE, Z_BELOW};
|
||||
use crate::world::tiles::magic_numbers::ASTAR_DEFAULT_WEIGHT;
|
||||
|
||||
/// Packed floor tile data for efficient storage. ~35 bytes vs 76 bytes tuple.
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -296,7 +297,7 @@ impl TileMap {
|
||||
self.floor_tiles
|
||||
.get(&world_pos)
|
||||
.map(|t| t.astar_weight)
|
||||
.unwrap_or(100)
|
||||
.unwrap_or(ASTAR_DEFAULT_WEIGHT)
|
||||
}
|
||||
|
||||
/// Remove a fixture tile, clearing both the HashMap entry and ChunkData bitsets.
|
||||
|
||||
Reference in New Issue
Block a user