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
25#[doc(hidden)]
26pub mod _private {
27    pub use bytemuck;
28    pub use inventory;
29}
30
31/// Highest player level covered by the embedded class base-stat tables.
32pub(crate) const MAX_BASE_STAT_LEVEL: usize = 90;
33
34/// Returns pre-gear attributes for a class, race, and level.
35#[must_use]
36pub fn character_base_stats(
37    class: wowlab_types::game::ClassId,
38    race: wowlab_types::game::RaceId,
39    level: u32,
40) -> stats::PrimaryStats {
41    let base = base_stats::class_base_stats(class, level);
42    let deltas = base_stats::race_stat_deltas(race);
43
44    stats::PrimaryStats {
45        strength: base.strength + deltas.strength,
46        agility: base.agility + deltas.agility,
47        stamina: base.stamina + deltas.stamina,
48        intellect: base.intellect + deltas.intellect,
49    }
50}