public Trainee(Trainee other) { foreach (PropertyInfo prop in other.GetType().GetRuntimeProperties()) { prop.SetValue(this, prop.GetValue(other)); } }
public Trainee(Trainee other) { notifications = new List <Notification>(other.notifications); foreach (PropertyInfo property in other.GetType().GetProperties()) { if (property.CanWrite) { property.SetValue(this, property.GetValue(other)); } } carTypeStats = new Dictionary <VehicleType, Stats>(); foreach (var item in other.carTypeStats) { carTypeStats.Add(item.Key, new Stats(item.Value)); } }