Пример #1
0
 private void SetFields()
 {
     Text = OnscreenText.Pentago;
     label_Pentago.Text   = OnscreenText.Pentago;
     label_your_move.Text = OnscreenText.YourMove;
     label_hint.Text      = OnscreenText.ChooseBall;
     lblActivePlayer.Text = OnscreenText.PlayerName(Player.GetActivePlayer().Name);
     SetNames();
     ShowScoreForAllPlayers();
     ShowPlayers();
 }
Пример #2
0
        private void OnSectorMouseClick(object sender, MouseEventArgs e)
        {
            if (IsBallNotSector)
            {
                return;
            }

            Sector sector = (Sector)sender;

            if (e.Button == MouseButtons.Left)
            {
                sector.TurnLeft();
            }

            if (e.Button == MouseButtons.Right)
            {
                sector.TurnRight();
            }

            int currentMaxScore = ScoreLogic.GetUpdatedMaximumScore();

            Game.ChangeScoreForAllPlayers();
            ShowScoreForAllPlayers();

            if (currentMaxScore >= Constants.WIN_SCORE)
            {
                SomeoneWins(currentMaxScore);
            }

            if (Game.HasNoWhiteBalls())
            {
                GameOver();
            }

            sector.Game.SetNextPlayerIndex();
            lblActivePlayer.Text = OnscreenText.PlayerName(Player.GetActivePlayer().Name);
            label_hint.Text      = OnscreenText.ChooseBall;

            IsBallNotSector = true;
        }