Exemple #1
0
 public static void ResetValues(Player player)
 {
     PropertyInfo[] pi = player.GetType().GetProperties();
     for (int i = 0; i < pi.Length; i++)
     {
         if (pi[i].PropertyType == typeof(int))
         {
             pi[i].SetValue(player, 0);
         }
         if (pi[i].PropertyType == typeof(string))
         {
             pi[i].SetValue(player, "");
         }
     }
 }