public void save(string name)
 {
     Player tmp = new Player();
     tmp.name = name;
     PlayerDAO dao = new PlayerDAO();
     dao.save(tmp);
 }
 public List<ScoreDTO> getRanking()
 {
     List<ScoreDTO> score_list = new List<ScoreDTO>();
     List<PlayerDTO> player_list = new PlayerDAO().selectAll();
     foreach (var player in player_list)
     {
         //score_list.Add(new ScoreDAO().getScore)
     }
     return score_list;
 }
Beispiel #3
0
        private void btnNewGame_Click(object sender, EventArgs e)
        {
            if (txtNewPlayer.Text == "")
            {
                MessageBox.Show("Please enter player name!");
            }
            else
            {
                tmp = new Player();
                tmp.name = txtNewPlayer.Text;
                tmp.id = new PlayerController().count()+1;
                PlayerDAO playerDAO = new PlayerDAO();
                playerDAO.save(tmp);
                txtNewPlayer.Text = "";
                this.Hide();
                new PlayerForm().Show();

            }
        }
Beispiel #4
0
        private void Start_Load(object sender, EventArgs e)
        {
            PlayerDAO playerDAO = new PlayerDAO();
            playerList = playerDAO.selectAll();

            for (int i = 0; i < playerList.Count; i++)
            {
                cmbProfile.Items.Add(playerList[i].name);
            }
        }