-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Task component #596
Task component #596
Conversation
A resource is any part of the game that can be used up and filled up. The purpose of this class is to simplify code throughout the game by placing it here. Instead of adding to health and then checking it isn't above max health, it's done automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - one minor comment, but not blocking.
I've encountered the situation before where I eject instead of dying. However, we need to make sure that this doesn't happen 100% of the time, with these latest code changes. |
Also, unfortunately, some of the CI builds broke. :-/ |
looks like Mac builds are breaking |
Fixed now. Note that I had a non-recurring seg-fault on one unit test. Since the test was also run successfully on other builds including other mac builds, I figured this was a fluke of some kind and re-ran the build and it passed. |
Opened #600 for it. |
This PR is part of a refactoring of the unit class. Specifically, it introduces the concept of resource.
A resource is any part of the game that can be used up and filled up.
The purpose of this class is to simplify code throughout the game by placing it here.
Instead of adding to health and then checking it isn't above max health, it's done automatically.
Money, energy, shield, armor are all examples of resource.
Note to reviewer:
This is a partial implementation of resource as a template. If I missed an overloaded operator or broke the rule of 0 or n, focus on that.
Code Changes:
Issues:
Purpose: