Skip to main content

wowlab_engine_domain/
lib.rs

1//! Pure simulation-domain policy shared by the engine's construction and runtime layers.
2
3#![expect(
4    clippy::multiple_crate_versions,
5    reason = "the workspace dependency graph currently resolves multiple transitive versions"
6)]
7#![expect(
8    clippy::redundant_feature_names,
9    // #t(rust_duplicate_strings) Rust attributes require a literal reason at the declaration they govern.
10    reason = "the cross-crate test-support capability name is mandated by the shared fixture contract"
11)]
12
13mod base_stats;
14pub mod constants;
15pub mod damage;
16pub mod dbc;
17pub mod encounter;
18pub mod gear;
19mod numeric;
20pub mod pool;
21pub mod rotation;
22pub mod stats;
23pub mod targeting;
24#[cfg(test)]
25mod test_alloc;
26
27#[cfg(test)]
28#[global_allocator]
29static TEST_ALLOCATOR: test_alloc::TestAllocator = test_alloc::TestAllocator;
30
31#[doc(hidden)]
32pub mod _private {
33    pub use bytemuck;
34    pub use inventory;
35}
36
37/// Highest player level covered by the embedded class base-stat tables.
38pub(crate) const MAX_BASE_STAT_LEVEL: usize = 90;
39
40/// Returns pre-gear attributes for a class, race, and level.
41#[must_use]
42pub fn character_base_stats(
43    class: wowlab_types::game::ClassId,
44    race: wowlab_types::game::RaceId,
45    level: u32,
46) -> stats::PrimaryStats {
47    let base = base_stats::class_base_stats(class, level);
48    let deltas = base_stats::race_stat_deltas(race);
49
50    stats::PrimaryStats {
51        strength: base.strength + deltas.strength,
52        agility: base.agility + deltas.agility,
53        stamina: base.stamina + deltas.stamina,
54        intellect: base.intellect + deltas.intellect,
55    }
56}