Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Armament refactor update #33

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Conversation

warp-core
Copy link
Owner

@warp-core warp-core commented Apr 4, 2024

No description provided.

mike-f1 and others added 30 commits April 4, 2024 16:41
This allow any weapon be "indexed" without doing
it externally.
...saving memory allocations but defining ctor and copy ctor
of Armament because the views must be recreated on copy.
...and discard 'const' requirement of 'Hardpoint' views
so we can 'Step' and 'Aim' only on those actually used.
Let Armament be able to calculate their minimum
and maximum guns range.
Saving an expensive loop in the middle of
doing something else.
Replaced with a couple of free funtion which are easier to
understand and do not need to be class members.
An 'Hardpoint' can be empty, so making that part of "views"
names may cause doubts; perhaps replacing that part of the
name with 'Weapons' (as done in methods) should helps.
...so it can accept an Hardpoint as argument.
Writing 'hardpoints[index]' is (more or less) like calling
a complete function each time: this should help compiler
spot the not-so-obvious optimization of using the result
of that call in-lieu of calling the very same function
multiple times.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants