public BlockPreviewRenderController(IBlockPreviewRenderView renderView,
                                            IBlockSpawnController spawnController,
                                            IBlockViewBuilder blockViewBuilder)
        {
            _renderView       = renderView;
            _spawnController  = spawnController;
            _blockViewBuilder = blockViewBuilder;

            _spawnController.OnNextBlockChange += RedrawBlockView;
        }
示例#2
0
        public BlockDrawingController(IBlockModelStorage blockModelStorage,
                                      IBlockViewBuilder blockViewBuilder,
                                      ILevelViewTransform viewTransform,
                                      IBlockViewRotationAnimator rotationAnimator,
                                      IBlockViewMovementAnimator movementAnimator)
        {
            _blockModelStorage = blockModelStorage;
            _blockViewBuilder  = blockViewBuilder;
            _viewTransform     = viewTransform;
            _rotationAnimator  = rotationAnimator;
            _movementAnimator  = movementAnimator;
            _blockToView       = new Dictionary <IBlockModel, IBlockView>();

            _blockModelStorage.OnBlockAdded   += OnBlockAdded;
            _blockModelStorage.OnBlockRemoved += OnBlockRemoved;
        }
 public BlockGhostController(IBlockViewBuilder blockViewBuilder,
                             ILevelViewTransform levelViewTransform,
                             ILevelPhysicsController levelPhysics,
                             IBlockModelStorage blockModelStorage,
                             Material ghostMaterial,
                             IBlockViewRotationAnimator rotationAnimator,
                             IBlockViewMovementAnimator movementAnimator)
 {
     _blockViewBuilder                  = blockViewBuilder;
     _levelViewTransform                = levelViewTransform;
     _levelPhysics                      = levelPhysics;
     _blockModelStorage                 = blockModelStorage;
     _ghostMaterial                     = ghostMaterial;
     _rotationAnimator                  = rotationAnimator;
     _movementAnimator                  = movementAnimator;
     _blockModelStorage.OnBlockAdded   += OnBlockAdded;
     _blockModelStorage.OnBlockRemoved += OnBlockRemoved;
 }