//Use this whenever adding a component to a ship. public ShipComponents CloneProperties() { ShipComponents dest = new ShipComponents(); dest.DesignReference = this; foreach (SubComponent c in SubComponents) { dest.SubComponents.Add(c.Clone()); } dest.Mass = Mass; foreach (Ability a in Abilities.Values) { dest.Abilities.Add(a.AbilityType, a.DeepClone()); } if (emissions != null) { dest.emissions = emissions.Clone(); } dest.CrewRequired = CrewRequired; dest.CrewPresent = CrewRequired; dest.HTK = HTK; dest.Name = Name; dest.Description = Description; dest.Obsolete = Obsolete; dest.Category = Category; dest.BuildDate = StrategicClock.GetDate(); dest.DesignDate = DesignDate; return(dest); }
/// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// /// <returns> /// A new object that is a copy of this instance. /// </returns> /// public override object Clone() { double[,] A = (double[, ])LogTransitions.Clone(); double[,] B = (double[, ])Emissions.Clone(); double[] pi = (double[])LogInitial.Clone(); return(new HiddenMarkovModel(A, B, pi, logarithm: true)); }