public HudLayoutInfo Clone() { return(new HudLayoutInfo { Name = Name, TableType = TableType, IsDefault = IsDefault, HudOpacity = HudOpacity, HudViewType = HudViewType, HudStats = HudStats.Select(s => s.Clone()).ToList(), HudPlayerTypes = HudPlayerTypes.Select(p => p.Clone()).ToList(), HudPositionsInfo = HudPositionsInfo.Select(p => p.Clone()).ToList(), HudBumperStickerTypes = HudBumperStickerTypes.Select(p => p.Clone()).ToList(), UiPositionsInfo = UiPositionsInfo.Select(u => u.Clone()).ToList() }); }
public HudSavedLayout Clone() { var clone = (HudSavedLayout)MemberwiseClone(); clone.HudStats = new List <StatInfo>(HudStats.Select(x => { var statInfoBreak = x as StatInfoBreak; if (statInfoBreak != null) { return(statInfoBreak.Clone()); } return(x.Clone()); })); clone.HudPlayerTypes = new List <HudPlayerType>(HudPlayerTypes.Select(x => x.Clone())); clone.HudBumperStickerTypes = new List <HudBumperStickerType>(HudBumperStickerTypes.Select(x => x.Clone())); clone.HudPositions = new List <HudSavedPosition>(HudPositions.Select(x => x.Clone())); return(clone); }