﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1.Memento
{
    class Aplikacija
    {
        public Editor editor;

        Snapshot snapshot;

        public Aplikacija()
        {
            editor = new Editor();
        }

        public void backup()
        {
            Snapshot snap = editor.createSnapshot();
            snapshot = snap;
        }

        public void restoreToPrevious()
        {
            if (snapshot != null)
                snapshot.restore();
        }
    }
}
