public void EditLevel(char part, int row, int column)
        {
            switch (part)
            {
            case '#':
                Designer.AddWall(row, column);
                RebuildLevel();
                break;

            case '@':
                Designer.AddPlayer(row, column);
                RebuildLevel();
                break;

            case '$':
                Designer.AddBlock(row, column);
                RebuildLevel();
                break;

            case '.':
                Designer.AddGoal(row, column);
                RebuildLevel();
                break;

            case '-':
                Designer.AddEmpty(row, column);
                RebuildLevel();
                break;
            }
        }
Example #2
0
        public void AddToLevel(int x, int y, char id)
        {
            try
            {
                switch (id)
                {
                case '#':
                    Designer.AddWall(x, y);

                    break;

                case '@':
                    Designer.AddPlayer(x, y);

                    break;

                case '$':
                    Designer.AddBlock(x, y);

                    break;

                case '.':
                    Designer.AddGoal(x, y);

                    break;

                case '-':
                    Designer.AddEmpty(x, y);

                    break;
                }
                DesignerView.UpdateLevel();
            }
            catch (ArgumentException e)
            {
                DesignerView.Display(e.Message);
            }
        }