Esempio n. 1
0
        public void Undo()
        {
            if (_current > 0)
            {
                _current--;
                MapClipboard r = new MapClipboard(_parent);
                r.Width  = Actions[_current].Clipboard.Width;
                r.Height = Actions[_current].Clipboard.Height;
                r.Copy(Actions[_current].X, Actions[_current].Y);
                RedoActions.Push(new HistoryElement(r, Actions[_current].X, Actions[_current].Y));


                Actions[_current].Clipboard.Paste(Actions[_current].X, Actions[_current].Y);
            }
        }
Esempio n. 2
0
        public void Add(int x, int y, int w, int h)
        {
            MapClipboard t = new MapClipboard(_parent);

            t.Width  = w;
            t.Height = h;
            t.Copy(x, y);
            if (_current == Actions.Count)
            {
                Actions.Add(new HistoryElement(t, x, y));
            }
            else
            {
                Actions.RemoveRange(_current, Actions.Count - _current);
                Actions.Add(new HistoryElement(t, x, y));
            }
            _current = Actions.Count;
            RedoActions.Clear();
        }
Esempio n. 3
0
 public Selector(MapEditor parent)
 {
     _parent    = parent;
     Input      = parent.Input;
     _clipboard = new MapClipboard(_parent);
 }
Esempio n. 4
0
 public HistoryElement(MapClipboard c, int x, int y)
 {
     X         = x;
     Y         = y;
     Clipboard = c;
 }