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:
2026-03-21 17:31:39 +00:00
parent 776d3caefc
commit 7fe33d4b2d
19 changed files with 159 additions and 45 deletions
-2
View File
@@ -7,8 +7,6 @@ pub const SEED: u32 = 420;
pub const PATHFINDER_SHORT_PATH_MAX_TILES: i32 = 64;
pub const PATHFINDER_MAX_NODES: usize = 15000;
pub const PATHFINDER_PROVISIONAL_NODE_LIMIT: usize = 256;
// Hierarchical pathfinding thresholds
// Tier 1: Same/adjacent chunk -> sync A* (fast, ~87µs)
// Tier 2: 2-4 chunks away -> Provisional + full path via queue
// Tier 3: >4 chunks away -> Hierarchical chunk-path + async segmented A*