📄 mementounit1.pas
字号:
unit MementoUnit1;
interface
type
TState = class
end;
TMemento = class
private
f_state: TState;
constructor Create;
procedure SetState(s: TState);
function GetState(): TState;
public
destructor Destroy; virtual;
end;
TOrigintor = class
private
f_state: TState;
public
function CreateMemento(): tmemento;
procedure SetMemento(amemento: TMemento);
end;
implementation
function TOrigintor.CreateMemento(): tmemento;
begin
//.....
end;
procedure TOrigintor.SetMemento(amemento: TMemento);
begin
//.....
end;
constructor TMemento.Create;
begin
//.....
end;
procedure TMemento.SetState(s: TState);
begin
//.....
end;
function TMemento.GetState(): TState;
begin
//.....
end;
destructor TMemento.Destroy;
begin
//.....
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -