//恢复角色状态 public void RecoveryState(RoleStateMemento memento) { roleState = memento.Clone(); //roleState.Vitality = memento.Vitality; //roleState.Attack = memento.Attack; //roleState.Defense = memento.Defense; }
//保存角色状态 public RoleStateMemento SaveState() { //RoleStateMemento memento = new RoleStateMemento(); //memento = roleState.Clone(); return(roleState.Clone());; //return (new RoleStateMemento(roleState.Vitality, roleState.Attack, roleState.Defense)); }