Exemple #1
0
        private void mouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                switch (((CustomButton)sender).Tag.ToString())
                {
                case "StartTag":
                    timer.AutoReset = true;
                    startTime       = DateTime.Now;
                    timer.Start();
                    startScreen[mapNumber - 1].Hide();
                    cbStart.Hide();
                    cbArrowLeft.MouseClick += new MouseEventHandler(mouseClick);
                    break;

                case "LeftTag":
                    if (backMoveCounter > 0)
                    {
                        clearMap(newMap);
                        originator.getStateFromMemento(careTaker.get(backMoveCounter - 1));
                        newMap.setMap(convertMapFromMemento(originator.getState()));
                        backMoveCounter--;
                        drawPreviousState(newMap);
                    }
                    break;
                }
            }
        }