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

Refactor Battle Engine (part 1) #132

Merged
merged 17 commits into from
Nov 16, 2020

Conversation

mdziekon
Copy link
Owner

@mdziekon mdziekon commented Nov 12, 2020

Summary:

CombatEngineAres.php is a huge pile of duplicated code all over the place. It's time to extract repeated pieces into reusable functionalities to improve readability (and future modifications), reduce complexity and accidental inconsistencies between attackers' & defenders' ships behaviour.

Changelog:

  • Move as much of duplicated code into reusable & generic helper functions that work for both attackers & defenders, also potentially the same or similar way for regular shots & "rapid fire" shots.
  • Improve rapid fire shots distribution when targeting multiple "users" with the same type of ship in a round. This improvement prevents "wasteful" shots being fired at one specific user, and spreads out targets more evenly.

Is migration required?

NO

Related issues or PRs:

@mdziekon mdziekon added pr:bugfix All pull requests related to fixing bugs pr:enhancement_request All pull requests related to enhancements proposals labels Nov 12, 2020
@mdziekon mdziekon changed the title Refactor Battle Engine Refactor Battle Engine (part 1) Nov 16, 2020
@mdziekon mdziekon marked this pull request as ready for review November 16, 2020 02:25
@mdziekon mdziekon merged commit c471882 into master Nov 16, 2020
@mdziekon mdziekon deleted the mdziekon/gh-131/battle-engine-refactor branch November 30, 2020 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix All pull requests related to fixing bugs pr:enhancement_request All pull requests related to enhancements proposals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant