Exemplo n.º 1
0
        public void insertCareerStats(careerStats combinedStats)
        {
            MySqlCommand queryCommand = new MySqlCommand();

            queryCommand.Connection  = conn;
            queryCommand.CommandText = "UPDATE playerStats SET  pawnsEaten = @pawnsEaten, pawnsLost = @pawnsLost, finalScore = @finalScore" +
                                       "WHERE personID= @personID";
            queryCommand.Prepare();
            queryCommand.Parameters.AddWithValue("@personID", combinedStats.getID());
            queryCommand.Parameters.AddWithValue("@pawnsEaten", combinedStats.getpawnsEaten());
            queryCommand.Parameters.AddWithValue("@pawnsLost", combinedStats.getPawnsLost());
            queryCommand.Parameters.AddWithValue("@finalScore", combinedStats.getFinalScore());
            try
            {
                MySqlDataReader reader = queryCommand.ExecuteReader();
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
            }
        }
Exemplo n.º 2
0
        public careerStats getNewCareerStats(gameStats y, careerStats x)
        {
            careerStats combinedStats = new careerStats(y.getID(), (y.getpawnsEaten() + x.getpawnsEaten()),
                                                        (y.getPawnsLost() + x.getPawnsLost()), (y.getFinalScore() + x.getFinalScore()));

            return(combinedStats);
        }