Пример #1
0
        public static BodyPartRecord GetRecord([NotNull] BodyPartRecord record, [NotNull] BodyDef otherDef)
        {
            if (record == null)
            {
                throw new ArgumentNullException(nameof(record));
            }
            if (otherDef == null)
            {
                throw new ArgumentNullException(nameof(otherDef));
            }
            var pAddr = record.GetAddress();

            return(otherDef.GetRecordAt(pAddr));
        }
Пример #2
0
        /// <summary>
        /// Transforms the specified record into a record from the target def
        /// </summary>
        /// <param name="record">The record.</param>
        /// <param name="targetDef">The target definition.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">record or targetDef</exception>
        public BodyPartRecord Transform(BodyPartRecord record, BodyDef targetDef)
        {
            if (record == null)
            {
                throw new ArgumentNullException(nameof(record));
            }
            if (targetDef == null)
            {
                throw new ArgumentNullException(nameof(targetDef));
            }
            var addr = record.GetAddress();

            return(targetDef.GetRecordAt(addr));
        }