コード例 #1
0
 public GameMiningController(GameMiningView view, MiningSceneViewDescription miningViewDescription, GameManager gameManager)
 {
     _view                         = view;
     _gameManager                  = gameManager;
     _ballPool                     = new BallPool(64, view.Ball);
     _gamePoleController           = new GamePoleController(_view.HintAnimation, _view.GamePoleView, _ballPool, _view.BallSpritesViewDescription, miningViewDescription, _view);
     _gamePoleController.GameOver += GameOver;
     _view.EndGame.onClick.AddListener(OnEndGame);
 }
コード例 #2
0
 public GenerateBalls(BallPoint sizePole, MiningSceneViewDescription miningViewDescription, BallPool ballPool)
 {
     _sizeGamePole          = sizePole;
     _typeBallResource      = miningViewDescription.TypeBallResource;
     _countColor            = miningViewDescription.Balls.Count;
     _percentageResources   = miningViewDescription.PercentageResources;
     _resources             = new ResourcesCount(miningViewDescription.TypeResources, miningViewDescription.CountResource);
     _miningViewDescription = miningViewDescription;
     _ballPool = ballPool;
 }
コード例 #3
0
        public GamePoleController(HintView hintView, GamePoleView gamePole, BallPool ballPool, BallSpritesViewDescription spritesViewDescription, MiningSceneViewDescription miningViewDescription, MonoBehaviour monoBehaviour)
        {
            _balls = new BallController[gamePole.CountHorCell, gamePole.CountVertCell];
            var checkBall                  = new CheckBall(new BallPoint(gamePole.CountHorCell, gamePole.CountVertCell));
            var movedController            = new MovedController(_balls, gamePole, checkBall);
            var destroyControler           = new DestroyControllerBall(_balls, movedController, ballPool);
            var checkChangedBallController = new CheckChangedBallController(_balls, checkBall);
            var fallBallContorller         = new FallControllerBall(_balls, movedController);
            var generateBalls              = new GenerateBalls(new BallPoint(gamePole.CountHorCell, gamePole.CountVertCell), miningViewDescription, ballPool);
            var newGenerateController      = new NewGenerateController(generateBalls, gamePole, _balls, spritesViewDescription, movedController);
            var hintController             = new HintControler(hintView, checkChangedBallController, monoBehaviour);

            _gamePoleStateControler           = new GamePoleStateControler(destroyControler, fallBallContorller, movedController, newGenerateController, checkChangedBallController, _balls, hintController);
            _gamePoleStateControler.GameOver += CallGameOver;

            gamePole.Activate();
            _gamePoleStateControler.StartGame();
        }