예제 #1
0
파일: Player.cs 프로젝트: nichdu/jeopardy
 public Player(Player previous)
 {
     _name = previous._name;
     _score = previous._score;
     _color = previous._color;
 }
예제 #2
0
파일: Form1.cs 프로젝트: nichdu/jeopardy
 private void constr(string jgPath, string player0Name, string player1Name, string player2Name)
 {
     InitializeComponent();
     game = JeopardyGame.GetInstance(jgPath);
     this.updateCategories();
     _players = new Player[3];
     _players[0] = new Player(player0Name, Color.Red);
     _players[1] = new Player(player1Name, Color.Lime);
     _players[2] = new Player(player2Name, Color.DeepSkyBlue);
     this.updatePlayerNames();
     this.resetScore();
     iterateButtons();
     _defaultButtonColor = cat1_100.BackColor;
 }
예제 #3
0
 public void SetPlayer(int id, string name)
 {
     if (id >= _players.Length)
     {
         throw new IndexOutOfRangeException("Spieler-ID darf nicht größer als " + id + " sein.");
     }
     _players[id] = new Player(name, _colors[id]);
 }