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

Rename Timer::{percent,percent_left} to Timer::{fraction,fraction_remaining} #10442

Merged
merged 3 commits into from
Nov 13, 2023
Merged

Rename Timer::{percent,percent_left} to Timer::{fraction,fraction_remaining} #10442

merged 3 commits into from
Nov 13, 2023

Conversation

mamekoro
Copy link
Contributor

@mamekoro mamekoro commented Nov 8, 2023

Objective

Fixes #10439

Timer::percent() and Timer::percent_left() return values in the range of 0.0 to 1.0, even though their names contain "percent".

These functions should be renamed for clarity.

Solution

  • Rename Timer::percent() to Timer::fraction()
  • Rename Timer::percent_left() to Timer::fraction_remaining()

Changelog

Changed

  • Renamed Timer::percent() to Timer::fraction()
  • Renamed Timer::percent_left() to Timer::fraction_remaining()

Migration Guide

  • Timer::percent() has been renamed to Timer::fraction()
  • Timer::percent_left() has been renamed to Timer::fraction_remaining()

@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide A-Time Involves time keeping and reporting labels Nov 8, 2023
@targrub
Copy link
Contributor

targrub commented Nov 8, 2023

While we're renaming, why not name it Timer::fraction_remaining()?

@mamekoro mamekoro changed the title Rename Timer::{percent,percent_left} to Timer::{fraction,fraction_left} Rename Timer::{percent,percent_left} to Timer::{fraction,fraction_remaining} Nov 9, 2023
@hymm hymm added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 11, 2023
@maniwani
Copy link
Contributor

maniwani commented Nov 12, 2023

0.12 release just added Time<Fixed>::overstep_percentage and Time<Fixed>::overstep_percentage_f64, which similarly return normalized values. It seems like they should become overstep_fraction to match.

Should that be included in this PR or should it be another one?

@mockersf
Copy link
Member

Should that be included in this PR or should it be another one?

I would prefer in this PR 👍

@mamekoro
Copy link
Contributor Author

#10448 will rename overstep_percentage(_f64).

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 13, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 13, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 13, 2023
Merged via the queue into bevyengine:main with commit 18d001d Nov 13, 2023
22 checks passed
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
…remaining}` (bevyengine#10442)

# Objective
Fixes bevyengine#10439

`Timer::percent()` and `Timer::percent_left()` return values in the
range of 0.0 to 1.0, even though their names contain "percent".

These functions should be renamed for clarity.

## Solution
- Rename `Timer::percent()` to `Timer::fraction()`
- Rename `Timer::percent_left()` to `Timer::fraction_remaining()`

---

## Changelog

### Changed
- Renamed `Timer::percent()` to `Timer::fraction()`
- Renamed `Timer::percent_left()` to `Timer::fraction_remaining()`

## Migration Guide
- `Timer::percent()` has been renamed to `Timer::fraction()`
- `Timer::percent_left()` has been renamed to
`Timer::fraction_remaining()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Time Involves time keeping and reporting C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Usability A simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timer::{percent,percent_left} should be renamed
7 participants