AcademyCraft

AcademyCraft

1M Downloads

Using val instead of lazy val or def when evaluate damage, consumption etc.

Mastize opened this issue ยท 1 comments

commented

There are many different kinds of representaion when evalute damage value, for example:
private def damage = lerpf(7, 16, skillExp)
private lazy val damage = lerpf(7, 16, skillExp)
lazy val damage = lerpf(7, 16, skillExp)
Since we create a new Context every time when player activate a skill, private val is just OK and more clear, better performance.

commented

Makes sense. It's such a small calculation that using lazy val/def causes more overhead.