0

let's say there is a hero class with characteristics: attack, health. And there is a helmet that can enhance these characteristics. How to do something when calling the "anequip" function of the property of the helmet, independently find the corresponding properties of the hero?

Describing a bunch of separate "hero.Atack:=helm.GetAttack()" functions is silly. The code becomes huge and unreadable, flexibility is lost. But so far I don't know how to do it differently.

0 Answers0