Пример #1
0
        /*
         * internal ExpandoObject ConvertToExpandoObject() {
         *      dynamic expando = new ExpandoObject();
         *
         *      expando.key = Key;
         *      expando.modSource = modSource;
         *      expando.internalName = internalName;
         *      expando.displayName = name;
         *
         *      expando.progression = progression;
         *      expando.downed = new Func<bool>(downed);
         *
         *      expando.isBoss = type.Equals(EntryType.Boss);
         *      expando.isMiniboss = type.Equals(EntryType.MiniBoss);
         *      expando.isEvent = type.Equals(EntryType.Event);
         *
         *      expando.npcIDs = new List<int>(npcIDs);
         *      expando.spawnItem = new List<int>(spawnItem);
         *      expando.loot = new List<int>(loot);
         *      expando.collection = new List<int>(collection);
         *
         *      return expando;
         * }
         */

        internal Dictionary <string, object> ConvertToDictionary(Version GetBossInfoAPIVersion)
        {
            // We may want to allow different returns based on api version.
            //if (GetBossInfoAPIVersion == new Version(1, 1)) {
            var dict = new Dictionary <string, object> {
                { "key", Key },
                { "modSource", modSource },
                { "displayName", name },
                { "internalName", internalName },

                { "progression", progression },
                { "downed", new Func <bool>(downed) },

                { "isBoss", type.Equals(EntryType.Boss) },
                { "isMiniboss", type.Equals(EntryType.MiniBoss) },
                { "isEvent", type.Equals(EntryType.Event) },

                { "npcIDs", new List <int>(npcIDs) },
                { "spawnItem", new List <int>(spawnItem) },
                { "loot", new List <int>(loot) },
                { "collection", new List <int>(collection) }
            };

            return(dict);
        }
Пример #2
0
        /// <summary>
        /// Returns true if TruststoreItems instances are equal
        /// </summary>
        /// <param name="other">Instance of TruststoreItems to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(TruststoreItems other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Alias == other.Alias ||
                     Alias != null &&
                     Alias.Equals(other.Alias)
                     ) &&
                 (
                     EntryType == other.EntryType ||
                     EntryType != null &&
                     EntryType.Equals(other.EntryType)
                 ) &&
                 (
                     Subject == other.Subject ||
                     Subject != null &&
                     Subject.Equals(other.Subject)
                 ) &&
                 (
                     Issuer == other.Issuer ||
                     Issuer != null &&
                     Issuer.Equals(other.Issuer)
                 ) &&
                 (
                     NotBefore == other.NotBefore ||
                     NotBefore != null &&
                     NotBefore.Equals(other.NotBefore)
                 ) &&
                 (
                     NotAfter == other.NotAfter ||
                     NotAfter != null &&
                     NotAfter.Equals(other.NotAfter)
                 ) &&
                 (
                     SerialNumber == other.SerialNumber ||
                     SerialNumber != null &&
                     SerialNumber.Equals(other.SerialNumber)
                 ));
        }
Пример #3
0
        /// <summary>
        /// Returns true if KeystoreItems instances are equal
        /// </summary>
        /// <param name="other">Instance of KeystoreItems to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(KeystoreItems other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Alias == other.Alias ||
                     Alias != null &&
                     Alias.Equals(other.Alias)
                     ) &&
                 (
                     EntryType == other.EntryType ||
                     EntryType != null &&
                     EntryType.Equals(other.EntryType)
                 ) &&
                 (
                     Algorithm == other.Algorithm ||
                     Algorithm != null &&
                     Algorithm.Equals(other.Algorithm)
                 ) &&
                 (
                     Format == other.Format ||
                     Format != null &&
                     Format.Equals(other.Format)
                 ) &&
                 (
                     Chain == other.Chain ||
                     Chain != null &&
                     Chain.SequenceEqual(other.Chain)
                 ));
        }