public HighScoresForm() { InitializeComponent(); PlayerList pl = HighScoresFunctions.readHighScores(); ListViewItem[] listViewItems = new ListViewItem[10]; for (int i = 0; i < 10; i++) { listViewItems[i] = new ListViewItem(pl.list[i].convert(i + 1), -1); } this.listView1.Items.AddRange(listViewItems); }
private void buttonOK_Click(object sender, EventArgs e) { if (this.textBox1.Text == "") { MessageBox.Show(this, "Your name must not be blank!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Player p = new Player(this.textBox1.Text, g.scores, g.hours, g.minutes, g.seconds); HighScoresFunctions.insert(p); this.Close(); new HighScoresForm().ShowDialog(); } }
public void applyGameShape(GameShape gameShape) { this.gameShape = gameShape; isSelected = false; isLocking = false; mainForm.setStepBack(false); stopAllThread(); timeThread = new TimeThread(this); int[,] matrix = gameShape.matrix; repaintPieces(matrix); repaintNextColor(matrix); repaintYScore(gameShape.scores); repaintHScore(HighScoresFunctions.getMaxScores()); repaintHour(gameShape.hours); repaintMinutes(gameShape.minutes); repaintSeconds(gameShape.seconds); }
public void setGameOver() { if (jumpThread != null) { jumpThread.Stop(); } if (timeThread != null) { timeThread.Stop(); } Player newPlayer = new Player("", gameShape.scores, gameShape.hours, gameShape.minutes, gameShape.seconds); Player worstPlayer = HighScoresFunctions.getWorstPlayer(); if (Player.less(newPlayer, worstPlayer)) { new HighScoresForm().ShowDialog(mainForm); } else { new WhatsYourName(gameShape).ShowDialog(mainForm); } newGame(); }