This reduces the number of times the fire rate is recalculated and avoids taking mutable/exclusive access to the players every frame.
This PlayerComponent.fire_period or what I renamed to base_attack_cooldown_seconds isnt really being used for anything. Should we delete it? Do you want this to not depend at all on the character type (captain vs juggernaut)?
Right now, the fire rate is entirely determined by
Technically we could also memoize this, but it shouldnt need to be recomputed every frame. I kinda prefer this to incrementally updating a struct field because here we know exactly why the value is what it is.
This reduces the number of times the fire rate is recalculated and avoids taking mutable/exclusive access to the players every frame.
This
PlayerComponent.fire_period
or what I renamed tobase_attack_cooldown_seconds
isnt really being used for anything. Should we delete it? Do you want this to not depend at all on the character type (captain vs juggernaut)?Right now, the fire rate is entirely determined by
Technically we could also memoize this, but it shouldnt need to be recomputed every frame. I kinda prefer this to incrementally updating a struct field because here we know exactly why the value is what it is.