# r41ngee/rdotaconstants architecture

> Architecture diagram of the GitHub repository r41ngee/rdotaconstants, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/r41ngee/rdotaconstants
- Repository: https://github.com/r41ngee/rdotaconstants

## Overview

rdotaconstants is a Rust library for looking up local Dota 2 heroes, abilities, items, and English localization strings. A consumer requests an entity by codename (or a hero by ID), then reads typed helpers or raw metadata; the data is embedded and decoded into memory for runtime access. The graph covers the public lookup types, shared entity/map layer, ability properties, and data corpus. Build-time conversion is documented, but its build machinery is intentionally omitted.

Main entry points: [`src/abilities.rs`](https://github.com/r41ngee/rdotaconstants/blob/main/src/abilities.rs) (Ability Lookup), [`src/heroes.rs`](https://github.com/r41ngee/rdotaconstants/blob/main/src/heroes.rs) (Hero Lookup), [`src/items.rs`](https://github.com/r41ngee/rdotaconstants/blob/main/src/items.rs) (Item Lookup), [`src/locals.rs`](https://github.com/r41ngee/rdotaconstants/blob/main/src/locals.rs) (Localization Table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Lookup API"]
  node_hero["Hero Lookup<br/>[heroes.rs]"]
  node_ability["Ability Lookup<br/>[abilities.rs]"]
  node_ability_props["Ability Properties<br/>[properties.rs]"]
  node_item["Item Lookup<br/>[items.rs]"]
end

subgraph group_shared["Shared Runtime"]
  node_locals[("Localization Table<br/>[locals.rs]")]
  node_entity["Entity Trait<br/>[entity.rs]"]
  node_map["Map Values<br/>[map.rs]"]
end

subgraph group_corpus["Game Data"]
  node_game_data[("Embedded Game Data")]
end

node_consumer(("Library Consumer"))

node_consumer -->|"looks up"| node_hero
node_consumer -->|"looks up"| node_ability
node_consumer -->|"looks up"| node_item
node_consumer -->|"reads strings"| node_locals
node_hero -->|"implements"| node_entity
node_ability -->|"implements"| node_entity
node_item -->|"implements"| node_entity
node_entity -->|"uses"| node_map
node_hero -->|"decodes data"| node_map
node_ability -->|"decodes data"| node_map
node_item -->|"decodes data"| node_map
node_ability_props -->|"extends"| node_ability
node_hero -->|"reads display name"| node_locals
node_ability -->|"reads labels"| node_locals
node_item -->|"reads labels"| node_locals
node_game_data -->|"supplies records"| node_hero
node_game_data -->|"supplies records"| node_ability
node_game_data -->|"supplies records"| node_item
node_game_data -->|"supplies strings"| node_locals

click node_hero "https://github.com/r41ngee/rdotaconstants/blob/main/src/heroes.rs"
click node_ability "https://github.com/r41ngee/rdotaconstants/blob/main/src/abilities.rs"
click node_ability_props "https://github.com/r41ngee/rdotaconstants/blob/main/src/abilities/properties.rs"
click node_item "https://github.com/r41ngee/rdotaconstants/blob/main/src/items.rs"
click node_locals "https://github.com/r41ngee/rdotaconstants/blob/main/src/locals.rs"
click node_entity "https://github.com/r41ngee/rdotaconstants/blob/main/src/entity.rs"
click node_map "https://github.com/r41ngee/rdotaconstants/blob/main/src/map.rs"
click node_game_data "https://github.com/r41ngee/rdotaconstants/tree/main/data"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hero,node_ability,node_ability_props,node_item toneBlue
class node_locals,node_entity,node_map toneAmber
class node_game_data toneMint
class node_consumer toneIndigo
```

## Components

### Lookup API

- [Hero Lookup](https://github.com/r41ngee/rdotaconstants/blob/main/src/heroes.rs): `src/heroes.rs`
- [Ability Lookup](https://github.com/r41ngee/rdotaconstants/blob/main/src/abilities.rs): `src/abilities.rs`
- [Ability Properties](https://github.com/r41ngee/rdotaconstants/blob/main/src/abilities/properties.rs): `src/abilities/properties.rs`
- [Item Lookup](https://github.com/r41ngee/rdotaconstants/blob/main/src/items.rs): `src/items.rs`

### Shared Runtime

- [Localization Table](https://github.com/r41ngee/rdotaconstants/blob/main/src/locals.rs): `src/locals.rs`
- [Entity Trait](https://github.com/r41ngee/rdotaconstants/blob/main/src/entity.rs): `src/entity.rs`
- [Map Values](https://github.com/r41ngee/rdotaconstants/blob/main/src/map.rs): `src/map.rs`

### Game Data

- [Embedded Game Data](https://github.com/r41ngee/rdotaconstants/tree/main/data): `data`

### Other components

- **Library Consumer**

## Connections

- Library Consumer → Hero Lookup: looks up (evidence: `README.md`)
- Library Consumer → Ability Lookup: looks up (evidence: `README.md`)
- Library Consumer → Item Lookup: looks up (evidence: `README.md`)
- Library Consumer → Localization Table: reads strings (evidence: `README.md`)
- Hero Lookup → Entity Trait: implements (evidence: `src/heroes.rs`)
- Ability Lookup → Entity Trait: implements (evidence: `src/abilities.rs`)
- Item Lookup → Entity Trait: implements (evidence: `src/items.rs`)
- Entity Trait → Map Values: uses (evidence: `src/entity.rs`)
- Hero Lookup → Map Values: decodes data (evidence: `src/heroes.rs`)
- Ability Lookup → Map Values: decodes data (evidence: `src/abilities.rs`)
- Item Lookup → Map Values: decodes data (evidence: `src/items.rs`)
- Ability Properties → Ability Lookup: extends (evidence: `src/abilities.rs`)
- Hero Lookup → Localization Table: reads display name (evidence: `src/heroes.rs`)
- Ability Lookup → Localization Table: reads labels (evidence: `src/abilities.rs`)
- Item Lookup → Localization Table: reads labels (evidence: `src/items.rs`)
- Embedded Game Data → Hero Lookup: supplies records (evidence: `README.md`)
- Embedded Game Data → Ability Lookup: supplies records (evidence: `README.md`)
- Embedded Game Data → Item Lookup: supplies records (evidence: `README.md`)
- Embedded Game Data → Localization Table: supplies strings (evidence: `README.md`)
