コード例 #1
0
 public Game(string player1Name, string player2Name)
 {
     Player1 = new Player();
     Player1.Name = player1Name;
     Player2 = new Player();
     Player2.Name = player2Name;
 }
コード例 #2
0
 public Game(string player1Name, string player2Name)
 {
     this.player1 = new Player(player1Name);
     this.player2 = new Player(player2Name);
     this.player1.Name = player1Name;
     this.player2.Name = player2Name;
 }
コード例 #3
0
ファイル: default.aspx.cs プロジェクト: JEAlcala/EpicU_Coding
 public Game(string playerName, Random random)
 {
     // Creating and setting the private objects.
     _player = new Player();
     _player.Name = playerName;
     PlayerName = _player.Name;
     _random = random;
 }
コード例 #4
0
 private void PlayRound(Player player)
 {
     for(int i = 0; i < 3; i++)
     {
         Dart dart = new Dart(Random);
         dart.Throw();
         Score.CalculateScore(player, dart);
     }
 }
コード例 #5
0
        public void performGame()
        {
            //Two players will take turns throwing three darts per turn.
            Player player1 = new Player();
            Player player2 = new Player();

            while (player1.Score < 300 && player2.Score < 300)
            {
                player1.Score += takeTurn();
                player2.Score += takeTurn();
            }

            this.Player1Score = player1.Score;
            this.Player2Score = player2.Score;
        }
コード例 #6
0
 public static void CalculateScore(Player player, Dart dart)
 {
     player.Score += CalculateScore(dart.Score, dart);
 }