Пример #1
0
    public ShootingTestData GetShootingTestRecords(int id)
    {
        ShootingTestData sh = new ShootingTestData();

        try
        {
            string       str  = "SELECT * FROM `shootingtest` WHERE UserId=" + id;
            MySqlCommand comm = new MySqlCommand(str, dbConnection);
            comm.CommandTimeout = 30;
            MySqlDataReader reader = comm.ExecuteReader();
            while (reader.Read())
            {
                sh.targetMiss    = reader.GetInt32(1);
                sh.targetHit     = reader.GetInt32(2);
                sh.accuracy      = reader.GetFloat(3);
                sh.shootingRange = reader.GetInt32(4);
                sh.minutesSpent  = reader.GetInt32(5);
                sh.secondsSpent  = reader.GetInt32(6);
            }
            reader.Close();
        }
        catch (Exception e)
        {
            Debug.LogError("Error While get Test Shooting Record ");
            Debug.LogError(e.ToString());
            ErrorDialougText.color = Color.red;
            ErrorDialougText.text  = "there is no user with this Id to add record to it ";
        }
        return(sh);
    }
 //Test Data sent to Trainig class to store
 public void SetTestShootingDataForSpecificUser(ShootingTestData testdata)
 {
     shootingData.SetShootingTestData(testdata);
 }
Пример #3
0
    //public ShootingTrainingData GetTrainingData()
    //{
    //    return shootingTrainingData;
    //}
    #endregion

    //Shooting Test Data
    #region Shooting Test Methods
    public void SetShootingTestData(ShootingTestData trainingData)
    {
    }