Ejemplo n.º 1
0
        public IBlock Build()
        {
            IBlock block = null;

            switch (_type)
            {
            case BlockType.Basic:
                block = new BasicBlock(_configuration, _size);
                break;

            case BlockType.ThreeLives:
                block = new ThreeLivesBlock(_configuration, _size);
                break;

            case BlockType.Irromptable:
                block = new IrromptableBlock(_configuration, _size);
                break;

            case BlockType.FireBallPrize:
                block = new PrizeBlock(_configuration, _size, _componentManager,
                                       _prizeFactory.GetFireBallPrize(_position));
                break;

            case BlockType.ThreeBallsPrize:
                block = new PrizeBlock(_configuration, _size, _componentManager,
                                       _prizeFactory.GetThreeBallsPrize(_position));
                break;

            case BlockType.BasicShooterPrize:
                block = new PrizeBlock(_configuration, _size, _componentManager,
                                       _prizeFactory.GetBasicShooterPrize(_position));
                break;

            case BlockType.WiderSpaceShipPrize:
                block = new PrizeBlock(_configuration, _size, _componentManager,
                                       _prizeFactory.GetWiderSpaceShipPrize(_position));
                break;

            case BlockType.RandomPrize:
                block = new RandomPrizeBlock(_configuration, _size, _componentManager, _prizeFactory);
                break;
            }

            if (_position != null)
            {
                block.Position = _position;
            }

            if (_scale != Vector2.Zero)
            {
                block.Scale = _scale;
            }

            if (_spriteColor != null)
            {
                block.SpriteColor = _spriteColor;
            }
            return(block);
        }
Ejemplo n.º 2
0
 IPrize NewWiderSpaceShipPrize(PrizeFactory prizeFactory)
 {
     return(prizeFactory.GetWiderSpaceShipPrize(Position));
 }
Ejemplo n.º 3
0
 IPrize NewBasicShooterPrize(PrizeFactory prizeFactory)
 {
     return(prizeFactory.GetWiderSpaceShipPrize(Position));
 }