Hero Factory
src.model.hero_factory
¶
Factory for predefined hero units and their sprite configurations.
The factory centralizes all playable hero definitions. Each hero method creates a
Unit with its combat competences, while sprite_config defines how the
corresponding sprite sheet must be indexed for idle, movement, attack, defense,
effect, and death animations.
The documentation follows Google-style docstrings so tools such as pdoc, Sphinx Napoleon, or MkDocs-based pipelines can expose parameters, return values, and side effects in a consistent HTML API reference.
HeroFactory
¶
Factory for constructing predefined hero units.
Each hero method returns a fully configured Unit with its attacks and
defenses. The factory also exposes sprite configuration data so the rendering
layer knows which frames belong to each unit state and competence.
The factory centralizes hero statistics, competences, and sprite metadata so the rest of the project can request heroes by name without duplicating setup data.
Notes
This class is documented as part of the public project API and is intended to be readable in generated HTML documentation.
Source code in src\model\hero_factory.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
sprite_config(name)
staticmethod
¶
Return sprite frame indexes and effect metadata for a hero name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Name identifying the asset, unit, competence, or registered resource. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
erza(x, y, team)
staticmethod
¶
Create the Erza hero with sword-based attacks and defensive aura skills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
gray(x, y, team)
staticmethod
¶
Create the Gray hero with ice-based attacks and defensive skills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
natsu(x, y, team)
staticmethod
¶
Create the Natsu hero with fire-based attacks and defensive skills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
kansuke(x, y, team)
staticmethod
¶
Create the Kansuke hero with sword techniques and defensive skills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
gowther(x, y, team)
staticmethod
¶
Create the Gowther hero with ranged magical attacks and barriers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
heisuke(x, y, team)
staticmethod
¶
Create the Heisuke hero with sword techniques and defensive skills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |
Source code in src\model\hero_factory.py
create_hero(name, x, y, team)
staticmethod
¶
Create a hero and its sprite configuration from a hero name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Name identifying the asset, unit, competence, or registered resource. |
required | |
x
|
Horizontal coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
y
|
Vertical coordinate in pixels, unless explicitly used as a grid coordinate. |
required | |
team
|
Team or player identifier used to separate allies from enemies. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
object |
Value produced by the underlying game or rendering operation. |