PaulQbFeng / too-tanky

3 stars 0 forks source link

Add spell factory #49

Closed PaulQbFeng closed 1 year ago

PaulQbFeng commented 1 year ago

Add spell factory that registers the class name with a decorator. spells can now be initialised inside BaseChampion.

Credit to @michaelbenayoun (btw see how it works without importing it first in init.py)

LinSun00 commented 1 year ago

J'avoue j'ai pas tout compris

PaulQbFeng commented 1 year ago

vas y je t'expliquerai pdnt un de nos meetings 2nd job

PaulQbFeng commented 1 year ago

Mais sen gros le decorateur registerspell au dessus de chaque spell permet de stocker le spell dans SpellFactory avec le bon champion et le bon spellkey, ce qui permet a l'initialisation des spells de le faire dans BaseChampion et non pas dans chaque module annie, xerath.py etc

Lysxia commented 1 year ago

very cool