예제 #1
0
        public bool Carregar()
        {
            DBConexao conexao = new DBConexao();
            string select = "select pl.Id as IdPlayer, pl.Nome as Nome, po.Data as DataJogo, po.Pontos as Pontos from Players pl inner join Pntuacao po on pl.Id = po.IdPlayers where pl.Nome like '"+nome+"'";

            MySqlDataReader data = conexao.Select(select);
            Pontuacao p;
            pontuacoes = new List<Pontuacao>();

            while (data.Read())
            {
                nome = (string)data["nome"];
                id = (int)data["IdPlayer"];
                p = new Pontuacao();
                p.Data = (DateTime)data["DataJogo"];
                p.Pontos = (long)data["Pontos"];
                pontuacoes.Add(p);
            }

            return true;
        }
예제 #2
0
 private void gameOver()
 {
     t.Stop();
     dece.Stop();
     seg.Stop();
     segundos = 0;
     Pontuacao p = new Pontuacao();
     p.Data = DateTime.Now;
     player.pontuacoes.Add(p);
     pontos = 0;
     ldlGameOver.Visible = true;
     restartBT.Visible = true;
 }