Skip to content

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

Open
@czh098tom

Description

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

现有方案的局限

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

实际使用遇到的问题

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

其他事项

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions