Undo/Redo implementation

后端 未结 10 1385
醉酒成梦
醉酒成梦 2020-11-28 18:59

Give me some thoughts how to implement undo/redo functionality - like we have in text editors. What algorithms should I use and what I may read. thanks.

10条回答
  •  盖世英雄少女心
    2020-11-28 19:21

    There are several ways to do this, but you could start looking at the Command pattern. Use a list of commands to move back (Undo) or forward (redo) through your actions. An example in C# can be found here.

提交回复
热议问题