Ejemplo n.º 1
0
    public GameModel
        (IPlayer player,
        IBallController ballController,
        IInputController input,
        ILevelConfiguration levelConfiguration,
        IControllerConfig controllerConfig,
        IGameCicle gameCicle,
        IBonusManager bonusManager,
        IFactory <Vector3, IBlock> blockFactory,
        IScoreController scoreController,
        ILifeController lifeController)
    {
        Player             = player;
        BallController     = ballController;
        Input              = input;
        LevelConfiguration = levelConfiguration;
        ControllerConfig   = controllerConfig;
        GameCicle          = gameCicle;
        BonusManager       = bonusManager;
        BlockFactory       = blockFactory;
        ScoreController    = scoreController;
        LifeController     = lifeController;

        SetListeners(true);

        GoToStart();
    }
Ejemplo n.º 2
0
 public LevelFactory(IEventAggregator eventAggregator, IScreenConfiguration screenConfiguration,
                     ILevelConfiguration levelConfiguration)
 {
     _eventAggregator     = eventAggregator;
     _screenConfiguration = screenConfiguration;
     _levelConfiguration  = levelConfiguration;
 }
Ejemplo n.º 3
0
    private void CreateBlocks(ILevelConfiguration config)
    {
        if (_blocks != null)
        {
            foreach (var block in _blocks)
            {
                block.Release();
            }
            _blocks.Clear();
        }
        else
        {
            _blocks = new List <IBlock>();
        }

        _currentBlocksCount = 0;

        foreach (var blockPlaceholder in config.BlocksPlaceholders)
        {
            var block = BlockFactory.Create(blockPlaceholder);
            _blocks.Add(block);
            block.Destroyed += OnBlockDestroy;
        }

        CurrentBlocksCount = _blocks.Count;
    }