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 fleet missions' code | Part 01 | Resources pillaging calculation #92

Merged
merged 17 commits into from
Mar 28, 2020

Conversation

mdziekon
Copy link
Owner

@mdziekon mdziekon commented Mar 25, 2020

Summary:

Currently there are three places with resources pillaging code duplicated. All of them should use a shared function to calculate how much resources should be pillaged from a raided planet / moon.

Changelog:

  • Extract resources pillaging function into its separate file
    • Rewrite it into something easier to understand
    • Fix the issue of uneven spreading in cases where left-over storage capacity of one low amount resource is incorrectly redistributed to other resources (and therefore, wasted even though the left-over was sufficient to allow pillage the entire pillagable amount of another resource)
    • Write tests
  • Use the new pillaging function in attacks handling functions:
    • Regular attack
    • Group attack (ACS)
    • Moon destruction

Related issues or PRs:

@mdziekon mdziekon added the pr:enhancement_request All pull requests related to enhancements proposals label Mar 25, 2020
@mdziekon mdziekon added this to In progress in Basic modernisation via automation Mar 25, 2020
@mdziekon mdziekon force-pushed the mdziekon/91/fleet-mission-attack-refactor-part01 branch from 383cc1d to 49c0446 Compare March 25, 2020 21:39
@mdziekon mdziekon added the pr:bugfix All pull requests related to fixing bugs label Mar 28, 2020
@mdziekon mdziekon marked this pull request as ready for review March 28, 2020 22:35
@mdziekon mdziekon merged commit 54c0c28 into master Mar 28, 2020
Basic modernisation automation moved this from In progress to Done Mar 28, 2020
@mdziekon mdziekon linked an issue Mar 29, 2020 that may be closed by this pull request
@mdziekon mdziekon deleted the mdziekon/91/fleet-mission-attack-refactor-part01 branch March 29, 2020 23:15
@mdziekon mdziekon removed this from Done in Basic modernisation Apr 8, 2022
@mdziekon mdziekon added this to In progress in Flight Control refactor via automation Apr 8, 2022
@mdziekon mdziekon moved this from In progress to Done in Flight Control refactor Apr 8, 2022
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
Development

Successfully merging this pull request may close these issues.

None yet

1 participant