# ponchisu/tp-magos-contra-mortifagos architecture

> Architecture diagram of the GitHub repository ponchisu/tp-magos-contra-mortifagos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ponchisu/tp-magos-contra-mortifagos
- Repository: https://github.com/ponchisu/tp-magos-contra-mortifagos

## Overview

This is a Java combat simulator for wizard and Death Eater battalions. Its main workflow is to create characters, assemble opposing battalions, and have battalion turns select and cast spells against targets; character states govern spell effects and combat status. The graph also shows the character/spell creation and state layers. Several source excerpts are partial, so links for less-visible behavior are limited to relationships listed in the SOURCE INDEX or described in the README.

Main entry points: [`src/app/BatallaMagosVsMortifagos.java`](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/app/BatallaMagosVsMortifagos.java) (Battle runner), [`src/character/Character.java`](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/character/Character.java) (Character core), [`src/wizard/Wizard.java`](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/wizard/Wizard.java) (Wizard hierarchy), [`src/deathEater/DeathEater.java`](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/deathEater/DeathEater.java) (Death Eater hierarchy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_battle["Battle orchestration"]
  node_runner["Battle runner"]
end

subgraph group_characters["Combatants and teams"]
  node_recruitment["Recruitment<br/>[ToRecruit.java]"]
  node_character["Character core<br/>[Character.java]"]
  node_wizard_team["Wizard battalion"]
  node_eater_team["Death Eater battalion"]
  node_wizard["Wizard hierarchy<br/>[Wizard.java]"]
  node_eater["Death Eater hierarchy<br/>[DeathEater.java]"]
  node_wizard_creators["Wizard creators"]
  node_eater_creators["Death Eater creators"]
end

subgraph group_spells["Spells and creation"]
  node_spell["Spell model<br/>[Spell.java]"]
  node_spell_effects["Spell effects"]
  node_spell_creators["Spell creators"]
end

subgraph group_states["Character states"]
  node_state_api["State behavior"]
  node_state_variants["State variants"]
end

node_wizard_actor(("Wizard player"))

node_wizard_actor -->|"starts"| node_runner
node_runner -->|"recruits"| node_recruitment
node_runner -->|"runs battle"| node_wizard_team
node_runner -->|"runs battle"| node_eater_team
node_recruitment -->|"creates wizards"| node_wizard_creators
node_recruitment -->|"creates foes"| node_eater_creators
node_wizard_creators -->|"creates subtype"| node_wizard
node_eater_creators -->|"creates subtype"| node_eater
node_wizard_team -->|"dispatches attacks"| node_wizard
node_eater_team -->|"dispatches attacks"| node_eater
node_wizard -->|"inherits"| node_character
node_eater -->|"inherits"| node_character
node_character -->|"validates and stores"| node_spell
node_spell_effects -->|"implements"| node_spell
node_wizard -->|"selects spells"| node_spell_creators
node_eater -->|"selects spells"| node_spell_creators
node_spell_creators -->|"constructs spells"| node_spell_effects
node_character -->|"delegates state actions"| node_state_api
node_state_api -->|"specializes behavior"| node_state_variants
node_state_variants -->|"casts spell"| node_spell

click node_runner "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/app/BatallaMagosVsMortifagos.java"
click node_recruitment "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/character/ToRecruit.java"
click node_character "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/character/Character.java"
click node_wizard_team "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/wizard/BattalionWizard.java"
click node_eater_team "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/deathEater/BattalionDeathEater.java"
click node_wizard "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/wizard/Wizard.java"
click node_eater "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/deathEater/DeathEater.java"
click node_wizard_creators "https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/wizardCreator"
click node_eater_creators "https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/deathEaterCreator"
click node_spell "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/spell/Spell.java"
click node_spell_effects "https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/spell"
click node_spell_creators "https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/spellCreator"
click node_state_api "https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/stateCharacter/StateCharacter.java"
click node_state_variants "https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/stateCharacter"

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_runner toneBlue
class node_recruitment,node_character,node_wizard_team,node_eater_team,node_wizard,node_eater,node_wizard_creators,node_eater_creators toneAmber
class node_spell,node_spell_effects,node_spell_creators toneMint
class node_state_api,node_state_variants toneRose
class node_wizard_actor toneIndigo
```

## Components

### Battle orchestration

- [Battle runner](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/app/BatallaMagosVsMortifagos.java): `src/app/BatallaMagosVsMortifagos.java`

### Combatants and teams

- [Recruitment](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/character/ToRecruit.java): `src/character/ToRecruit.java`
- [Character core](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/character/Character.java): `src/character/Character.java`
- [Wizard battalion](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/wizard/BattalionWizard.java): `src/wizard/BattalionWizard.java`
- [Death Eater battalion](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/deathEater/BattalionDeathEater.java): `src/deathEater/BattalionDeathEater.java`
- [Wizard hierarchy](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/wizard/Wizard.java): `src/wizard/Wizard.java`
- [Death Eater hierarchy](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/deathEater/DeathEater.java): `src/deathEater/DeathEater.java`
- [Wizard creators](https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/wizardCreator): `src/wizardCreator`
- [Death Eater creators](https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/deathEaterCreator): `src/deathEaterCreator`

### Spells and creation

- [Spell model](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/spell/Spell.java): `src/spell/Spell.java`
- [Spell effects](https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/spell): `src/spell`
- [Spell creators](https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/spellCreator): `src/spellCreator`

### Character states

- [State behavior](https://github.com/ponchisu/tp-magos-contra-mortifagos/blob/main/src/stateCharacter/StateCharacter.java): `src/stateCharacter/StateCharacter.java`
- [State variants](https://github.com/ponchisu/tp-magos-contra-mortifagos/tree/main/src/stateCharacter): `src/stateCharacter`

### Other components

- **Wizard player**

## Connections

- Wizard player → Battle runner: starts (evidence: `src/app/BatallaMagosVsMortifagos.java`)
- Battle runner → Recruitment: recruits (evidence: `src/app/BatallaMagosVsMortifagos.java`)
- Battle runner → Wizard battalion: runs battle (evidence: `src/app/BatallaMagosVsMortifagos.java`)
- Battle runner → Death Eater battalion: runs battle (evidence: `src/app/BatallaMagosVsMortifagos.java`)
- Recruitment → Wizard creators: creates wizards (evidence: `src/character/ToRecruit.java`)
- Recruitment → Death Eater creators: creates foes (evidence: `src/character/ToRecruit.java`)
- Wizard creators → Wizard hierarchy: creates subtype (evidence: `src/wizardCreator/WizardStudentCreator.java`)
- Death Eater creators → Death Eater hierarchy: creates subtype (evidence: `src/deathEaterCreator/DeathEaterCommanderCreator.java`)
- Wizard battalion → Wizard hierarchy: dispatches attacks (evidence: `src/wizard/BattalionWizard.java`)
- Death Eater battalion → Death Eater hierarchy: dispatches attacks (evidence: `src/deathEater/BattalionDeathEater.java`)
- Wizard hierarchy → Character core: inherits (evidence: `src/wizard/Wizard.java`)
- Death Eater hierarchy → Character core: inherits (evidence: `src/deathEater/DeathEater.java`)
- Character core → Spell model: validates and stores (evidence: `src/character/Character.java`)
- Spell effects → Spell model: implements (evidence: `src/spell/Spell.java`)
- Wizard hierarchy → Spell creators: selects spells (evidence: `src/wizard/WizardAuror.java`)
- Death Eater hierarchy → Spell creators: selects spells (evidence: `src/deathEater/DeathEaterCommander.java`)
- Spell creators → Spell effects: constructs spells (evidence: `src/spellCreator/CrucioCreator.java`)
- Character core → State behavior: delegates state actions (evidence: `src/character/Character.java`)
- State behavior → State variants: specializes behavior (evidence: `src/stateCharacter/Idle.java`)
- State variants → Spell model: casts spell (evidence: `src/stateCharacter/Idle.java`)
