🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ package memento import ( "testing" ) func TestMemento(t *testing.T) { gr := GameRole{} gr.GetInitState() gr.StateDisplay() caretaker := RoleStateCaretaker{} caretaker.memento = gr.SaveState() gr.Fight() gr.StateDisplay() gr.RecoveryState(caretaker.memento) gr.StateDisplay() } ~~~