예제 #1
0
 public GameOverState(IGameplayController gameplayController,
                      IGameOverController gameOverController,
                      IScoreSystem scoreSystem)
 {
     this.gameplayController = gameplayController;
     this.gameOverController = gameOverController;
     this.scoreSystem        = scoreSystem;
 }
예제 #2
0
 public BeginGameState(IRoot root,
                       ILevelGenerator levelGenerator,
                       ITurnSystem turnSystem,
                       IMatchSystem matchSystem,
                       IGameplayController gameplayController,
                       IScoreSystem scoreSystem)
 {
     this.root               = root;
     this.levelGenerator     = levelGenerator;
     this.turnSystem         = turnSystem;
     this.matchSystem        = matchSystem;
     this.gameplayController = gameplayController;
     this.scoreSystem        = scoreSystem;
 }
예제 #3
0
        private void GameplayForm_Load(object sender, EventArgs e)
        {
            PlayerPaddle paddleModel = new PlayerPaddle(this.Width, this.Height, this.Width, this.Height);
            int          ballX       = this.Width / 2 - 15;
            int          ballY       = this.Height / 2 + 50;
            Ball         ballModel   = new Ball(ballX, ballY, this.Width, this.Height);

            pictureBoxPaddle.Size = new Size(paddleModel.Width, paddleModel.Height);
            pictureBoxBall.Size   = new Size(ballModel.Width, ballModel.Height);

            TargetBlocksCollection targetBlocksCollection = GenerateTargetBlocks();

            SetMessageLocations();
            MessageHandler messageHandler = new MessageHandler(this.labelStatus, this.labelMessage, this.labelScore);

            this.gameplayController = new GameplayController(this, paddleModel, pictureBoxPaddle, ballModel,
                                                             this.pictureBoxBall, targetBlocksCollection, messageHandler);

            Application.Idle += RunLoop;
            loopIsRunning     = true;
        }