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

[PlayerSpaceship] Deprecate redundant energy functions #1865

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

Conversation

oznogon
Copy link
Contributor

@oznogon oznogon commented Jan 18, 2023

PlayerSpaceship has redundant getter/setter functions for energy:

  • getEnergyLevel()
  • setEnergyLevel()
  • getEnergyLevelMax()
  • setEnergyLevelMax()

Deprecate these in favor of the parent SpaceShip class's functions:

  • getEnergy()
  • setEnergy()
  • getMaxEnergy()
  • setMaxEnergy()

Move the PlayerSpaceship energy setter logic, which capped values
to a range of 0 to max_energy_level, to the SpaceShip class's
behavior, which discarded values less than 0 but accepted all
others.

Replace use of these ...EnergyLevel... functions.

@oznogon oznogon force-pushed the deprecate-player-energy-functions branch from 25ed389 to bd9baa6 Compare January 19, 2023 19:18
@oznogon oznogon changed the title Deprecate redundant PlayerSpaceship energy functions [PlayerSpaceship] Deprecate redundant energy functions Jan 22, 2023
PlayerSpaceship has redundant getter/setter functions for energy:

- `getEnergyLevel()`
- `setEnergyLevel()`
- `getEnergyLevelMax()`
- `setEnergyLevelMax()`

Deprecate these in favor of the parent SpaceShip class's functions:

- `getEnergy()`
- `setEnergy()`
- `getMaxEnergy()`
- `setMaxEnergy()`

Move the PlayerSpaceship energy setter logic, which capped values
to a range of 0 to max_energy_level, to the SpaceShip class's
behavior, which discarded values less than 0 but accepted all
others.
@oznogon oznogon force-pushed the deprecate-player-energy-functions branch from bd9baa6 to f183985 Compare March 19, 2023 22:28
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.

None yet

1 participant