コード例 #1
0
ファイル: PK3.cs プロジェクト: sutiam/PKHeX
        public override PKM Clone()
        {
            // Don't use the byte[] constructor, the DecryptIfEncrypted call is based on checksum.
            // An invalid checksum will shuffle the data; we already know it's un-shuffled. Set up manually.
            var pk = new PK3();

            Data.CopyTo(pk.Data, 0);
            return(pk);
        }
コード例 #2
0
        /// <summary>
        /// Converts a <see cref="CK3"/> or <see cref="XK3"/> to <see cref="PK3"/>.
        /// </summary>
        /// <returns><see cref="PK3"/> format <see cref="PKM"/></returns>
        public PKM convertToPK3()
        {
            if (Format != 3)
            {
                return(null);
            }
            if (GetType() == typeof(PK3))
            {
                return(this);
            }
            var pk = new PK3();

            TransferPropertiesWithReflection(this, pk);
            pk.RefreshChecksum();
            return(pk);
        }