A shared ValueActorInit<T> is introduced to reduce duplication
in the most common init cases, and an ActorInitActorReference
allow actors to be referenced by map.yaml name.
On bleed, if AllowMovement is true actors with ReturnFire will actually follow the acquired target, unlike in Defend stance.
This is at least unintuitive, since ReturnFire is expected to be more passive than Defend.
- Rename Bits<T> to BitSet<T>.
- Implement set based helpers for BitSet<T>.
- When representing TargetTypes of ITargetable in various traits, use a BitSet<TargetableType> instead of HashSet<string> for better performance & reduced memory usage.
- Fix FieldLoader to trim input values when generating a BitSet<T>.
- Require T in BitSet<T> and BitSetAllocator<T> to be a class since it's just a marker value. This allows the JIT to instantiate generic code for these classes once, as they don't benefit from specialized code for T. (Typically JITs will generate shared code for all reference types, and unique code for every value type encountered).
- Cache active target query.
- Prefer .Count == 0 over Any when working with Lists.
- Use helper for GetEnabledTargetTypes.
- Don't declare target variable until actually needed.
Just a by-product from a previous commit, not meant to do anything specific other than bringing us a tiny step closer to requiring explicit implementations for these interfaces too, at some point.
Added a Damage class to pass damage value and damage(types) instead.
This removes a great amount of overhead and longterm opens possibilities to have damagetypes without warheads.
At least in theory, it's possible for an actor to have multiple AttackFollow traits, or AttackFollow is disabled initially but enabled via upgrade later.
To avoid crashes or other issues, let's play it safe and take the same approach as with AttackBase look-ups.