Esempio n. 1
0
    public void StaticComponentsDisplay()
    {
        var blockFactory = new BlockFactory();
        var visualizer   = new ElementVisualizaer();

        visualizer.Add(blockFactory.GetStone(0, 0));
        visualizer.Add(blockFactory.GetStairs(20, 0));
        visualizer.Add(blockFactory.GetGold(40, 0));
        visualizer.Add(blockFactory.GetRail(60, 0));
        visualizer.Add(blockFactory.GetGameOver(0, 40));

        visualizer.Start();
    }
Esempio n. 2
0
        private void AddObject(int x, int y)
        {
            if (!IsAboveObject(x, y))
            {
                switch (selectedObject)
                {
                case '1':
                    model.Add(blockFactory.GetStone(x, y));
                    break;

                case '2':
                    model.Add(blockFactory.GetWater(x, y));
                    break;

                case '3':
                    model.Add(blockFactory.GetBrick(x, y));
                    break;

                case '4':
                    model.Add(blockFactory.GetStairs(x, y));
                    break;

                case '5':
                    model.Add(blockFactory.GetRail(x, y));
                    break;

                case '6':
                    model.Add(blockFactory.GetGold(x, y));
                    model.MaxScore++;
                    break;

                case '7':
                    model.Player = blockFactory.GetPlayer(x, y);
                    break;
                }
            }
        }