public Player(Player previous) { _name = previous._name; _score = previous._score; _color = previous._color; }
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; }
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]); }