public void OnClick(Object sender, EventArgs o)
 {
     returnedState = ((HistoryButton)sender).mapState;
     DialogResult = System.Windows.Forms.DialogResult.OK;
     Close();
 }
        public void PushHistory(MapState mapstate)
        {
            if (Buffer.Count() == Max) Buffer.RemoveFirst();

            Buffer.AddLast(mapstate);
        }