Ejemplo n.º 1
0
        private void NeuerMaler_Click(object sender, RoutedEventArgs e)
        {
            IPaint paint = null;
            IWalk  walk  = null;

            // Momentan noch statische Werte
            // Evtl. die Maleigenschaften, die hier gebraucht werden als Variablen von dieser WindowKlasse setzen
            if (Malarten.SelectedIndex == 0)
            {
                paint = new PaintImage(new Image());
            }
            else if (Malarten.SelectedIndex == 1)
            {
                paint = new PaintSpray(Colors.Black, new Size(2, 2));
            }
            if (BewArten.SelectedIndex == 0)
            {
                walk = new WalkDirectional(7, 3);
            }
            else if (BewArten.SelectedIndex == 1)
            {
                walk = new WalkRectangular(10, 7, 20, 8, 2, DirType.Up);
            }

            Painter newPainter = new Painter(paint, walk);

            newPainter.setStartPos(new Point(0, 0));
            if ((paint != null) && (walk != null))
            {
                DrawingCanvas.AddPainter(newPainter);
            }

            //Maler
        }