bevy/crates
Sean Sullivan 4b61bbe4e1
bevy_core: Derive useful traits on FrameCount (#13291)
# Objective

I am emboldened by my last small PR and am here with another.

- **Describe the objective or issue this PR addresses.**

It would be nice if `FrameCount` could be used by downstream plugins
that want to use frame data. The example that I have in mind is
[`leafwing_input_playback`](https://github.com/Leafwing-Studios/leafwing_input_playback/issues/29)
which has a [duplicate implementation of
`FrameCount`](https://github.com/Leafwing-Studios/leafwing_input_playback/blob/main/src/frame_counting.rs#L9-L37)
used in several structs which rely on those derives (or otherwise the
higher-level structs would have to implement these traits manually).
That crate, using `FrameCount`, tracks input frames and timestamps and
enables various playback modes.

I am aware that bevy org refrains from deriving lots of unnecessary
stuff on bevy types to avoid compile time creep. It is worth mentioning
the (equally reasonable) alternative that downstream crates _should_
implement some `FrameCount` themselves if they want special behavior
from it.

## Solution

- **Describe the solution used to achieve the objective above.**

I added derives for `PartialEq, Eq, PartialOrd, Ord` and implementations
for `serde::{Deserialize, Serialize}` to `FrameCount`.

## Testing

Manually confirmed that the serde implementation works, but that's all.
Let me know if I should do more here.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-05-10 10:00:08 +00:00
..
bevy_a11y Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_animation Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_app Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_asset Make AssetMetaCheck a field on the asset plugin (#13177) 2024-05-07 23:52:30 +00:00
bevy_audio Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_color Add color conversions #13224 (#13276) 2024-05-09 18:01:52 +00:00
bevy_core bevy_core: Derive useful traits on FrameCount (#13291) 2024-05-10 10:00:08 +00:00
bevy_core_pipeline Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00
bevy_derive Update compile test to use ui_test 0.23 (#13245) 2024-05-05 22:17:56 +00:00
bevy_dev_tools new format for ci config file (#13154) 2024-05-02 22:51:47 +00:00
bevy_diagnostic Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dylib Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dynamic_plugin Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ecs Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_encase_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gilrs Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gizmos Add AXES iterators for Dir types (#13305) 2024-05-09 23:30:44 +00:00
bevy_gltf Implement clearcoat per the Filament and the KHR_materials_clearcoat specifications. (#13031) 2024-05-05 22:57:05 +00:00
bevy_hierarchy Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_input Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_internal Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_log Remove bevy log's usage of non send resource (#13252) 2024-05-06 21:15:10 +00:00
bevy_macro_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_math Add AXES iterators for Dir types (#13305) 2024-05-09 23:30:44 +00:00
bevy_mikktspace Update glam version requirement from 0.25 to 0.27 (#12757) 2024-05-02 18:42:34 +00:00
bevy_pbr Add color conversions #13224 (#13276) 2024-05-09 18:01:52 +00:00
bevy_ptr Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect bevy_reflect: Remove ContainerAttributes::merge (#13303) 2024-05-09 18:17:54 +00:00
bevy_render Fix the WebGL 2 backend by giving the visibility_ranges array a fixed length. (#13210) 2024-05-08 07:34:59 +00:00
bevy_scene Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_sprite Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00
bevy_state Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_tasks multi_threaded feature rename (#12997) 2024-05-06 20:49:32 +00:00
bevy_text Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_time Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_transform Use Dir3 for local axis methods in GlobalTransform (#13264) 2024-05-06 20:52:05 +00:00
bevy_ui Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00
bevy_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_window Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_winit Simplify winit runner exit code reporting (#13151) 2024-05-03 00:17:39 +00:00