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

Implement Serialize/Deserialize for Timer and Stopwatch #6244

Closed
bzm3r opened this issue Oct 12, 2022 · 0 comments
Closed

Implement Serialize/Deserialize for Timer and Stopwatch #6244

bzm3r opened this issue Oct 12, 2022 · 0 comments
Labels
A-Time Involves time keeping and reporting C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@bzm3r
Copy link
Contributor

bzm3r commented Oct 12, 2022

What problem does this solve or what need does it fill?

For example: cooldown related game actions benefit from a Timerto keep track of how much time has passed since the last action use. It is also useful to be able to serialize actions, for the purposes of input mocking, macro-ing, and so on.

What solution would you like?

Implement Serialize/Deserialize for timing mechanisms like Timer and Stopwatch.

What alternative(s) have you considered?

Create our own stopwatch like struct to keep track of time, that also has Serialize/Deserialize available.

Additional context

This is coming up when extending leafwing-input-manager to support actions with cooldowns.

@bzm3r bzm3r added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Oct 12, 2022
@bzm3r bzm3r changed the title Implement serialize/deserialize for Timer and Stopwatch Implement Serialize/Deserialize for Timer and Stopwatch Oct 12, 2022
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Time Involves time keeping and reporting and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Oct 12, 2022
@bors bors bot closed this as completed in bfbcd47 Oct 17, 2022
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 19, 2022
…Stopwatch (bevyengine#6248)

# Objective

Fixes bevyengine#6244

## Solution

Uses derive to implement `Serialize` and `Deserialize` for `Timer` and `Stopwatch`

### Things to consider
- Should fields such as `finished` and `times_finished_this_tick` in `Timer` be serialized?
- Does `Countdown` and `PrintOnCompletionTimer` need to be serialized and deserialized?

## Changelog

Added `Serialize` and `Deserialize` implementations to `Timer` and `Stopwatch`, `Countdown`.
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
…Stopwatch (bevyengine#6248)

# Objective

Fixes bevyengine#6244

## Solution

Uses derive to implement `Serialize` and `Deserialize` for `Timer` and `Stopwatch`

### Things to consider
- Should fields such as `finished` and `times_finished_this_tick` in `Timer` be serialized?
- Does `Countdown` and `PrintOnCompletionTimer` need to be serialized and deserialized?

## Changelog

Added `Serialize` and `Deserialize` implementations to `Timer` and `Stopwatch`, `Countdown`.
Pietrek14 pushed a commit to Pietrek14/bevy that referenced this issue Dec 17, 2022
…Stopwatch (bevyengine#6248)

# Objective

Fixes bevyengine#6244

## Solution

Uses derive to implement `Serialize` and `Deserialize` for `Timer` and `Stopwatch`

### Things to consider
- Should fields such as `finished` and `times_finished_this_tick` in `Timer` be serialized?
- Does `Countdown` and `PrintOnCompletionTimer` need to be serialized and deserialized?

## Changelog

Added `Serialize` and `Deserialize` implementations to `Timer` and `Stopwatch`, `Countdown`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
…Stopwatch (bevyengine#6248)

# Objective

Fixes bevyengine#6244

## Solution

Uses derive to implement `Serialize` and `Deserialize` for `Timer` and `Stopwatch`

### Things to consider
- Should fields such as `finished` and `times_finished_this_tick` in `Timer` be serialized?
- Does `Countdown` and `PrintOnCompletionTimer` need to be serialized and deserialized?

## Changelog

Added `Serialize` and `Deserialize` implementations to `Timer` and `Stopwatch`, `Countdown`.
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-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
2 participants