⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mementounit1.pas

📁 设计模式delphi版给想学delphi的朋友一个很有价值的参考
💻 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 + -