Exemplo n.º 1
0
 public static void writedefault()
 {
     player[] p = new player[10];
     for (int i = 0; i < 10; i++)
     {
         p[i] = new player("Victory", 10, 0, 1, 0);
     }
     write(new playerlist(p));
 }
Exemplo n.º 2
0
 public static void insert(player p)
 {
     playerlist pl = readhigh();
     int i, j;
     for (i = 0; i < 10; i++)
         if (player.sapxep(p, pl.list[i])) break;
     for (j = 9; j >= i + 1; j--)
         pl.list[j] = pl.list[j - 1];
     pl.list[i] = p;
     write(pl);
 }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text == "")
     {
         MessageBox.Show(" Ban phai dien ten cua ban ", " Thong Bao ");
     }
     else
     {
         player p = new player(textBox1.Text, Form1.moves, Form1.gio, Form1.phut, Form1.giay);
         function.insert(p);
         this.Close();
         new HighScores().ShowDialog();
     }
 }
Exemplo n.º 4
0
 public playerlist(player[] list1)
 {
     this.list = list1;
 }
Exemplo n.º 5
0
 public static bool sapxep(player p1, player p2)
 {
     if (p1.diem != p2.diem)
         return p1.diem < p2.diem;
     return p1.tinhgio() < p2.tinhgio();
 }