コード例 #1
0
 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()
     });
 }
コード例 #2
0
        /// <summary>
        /// Creates a copy of the current <see cref="HudLayoutInfoV2"/> instance
        /// </summary>
        /// <returns>Copy of the current <see cref="HudLayoutInfoV2"/> instance</returns>
        public HudLayoutInfoV2 Clone()
        {
            var cloned = new HudLayoutInfoV2
            {
                Name                  = Name,
                IsDefault             = IsDefault,
                Opacity               = Opacity,
                TableType             = TableType,
                HudBumperStickerTypes = HudBumperStickerTypes.Select(x => x.Clone()).ToList(),
                HudPlayerTypes        = HudPlayerTypes.Select(x => x.Clone()).ToList(),
                LayoutTools           = LayoutTools.Select(x => x.Clone()).ToList(),
                Filter                = Filter?.Clone(),
                TrackMeterPositions   = TrackMeterPositions?.Select(x => x.Clone()).ToList()
            };

            return(cloned);
        }
コード例 #3
0
        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);
        }