bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.71k stars 3.53k forks source link

Make methods on `Time`, `Timer`, and `Stopwatch` more consistent #15834

Open rparrett opened 3 days ago

rparrett commented 3 days ago

Bevy version

0.14 / main

What you did

Noticed some small inconsistencies between Time, Timer and Stopwatch while refactoring.

What went wrong

This may not be totally comprehensive.

Time Timer Stopwatch
elapsed_seconds elapsed_secs elapsed_secs
elapsed_seconds_f64 DNE elapsed_secs_f64
is_paused paused paused

At a glance, it seems like we should

Additional information

When deciding on renames there may be other methods to look at (animation, audio, whatever) with similarly-named methods. e.g. AudioSink::is_paused, Duration::from_secs.

tim-blackbird commented 3 days ago
  • Rename *_seconds to *_secs or vice versa

I think we should follow the rust standard library and go with *_secs

  • Rename paused to is_paused or vice versa

The std shows a clear preference for is_*