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

提供随机数发生器的更多功能(保存状态和从状态恢复) #17

Open
czh098tom opened this issue Jun 15, 2023 · 1 comment
Labels
enhancement New feature or request resolved and waiting for review The issue has been resolved, waiting for review and feedback

Comments

@czh098tom
Copy link

说明
目前随机数发生器只有从某seed开始不断取后续值的功能,遇到需要从中间某状态恢复的需求时则较为困难

现有方案的局限

  • 无法复制随机数发生器的状态,只能从种子开始连续取随机次数个随机数

实际使用遇到的问题

  • 为了从某个游戏状态中恢复,随机数发生器作为一个外部系统需要同时可以和其他游戏状态一起回滚

其他事项

  • 建议使随机数发生器的状态可序列化,这样方便进行文件写入等操作
@Demonese
Copy link
Contributor

已在 0.20.10 中添加 clone 和 serialize 功能

@Demonese Demonese added enhancement New feature or request resolved and waiting for review The issue has been resolved, waiting for review and feedback labels Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request resolved and waiting for review The issue has been resolved, waiting for review and feedback
Projects
None yet
Development

No branches or pull requests

2 participants