Example #1
0
        /// <summary>
        /// Returns true if CharacterTokiResponse instances are equal
        /// </summary>
        /// <param name="other">Instance of CharacterTokiResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CharacterTokiResponse other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UnlimitedRecordCount == other.UnlimitedRecordCount ||
                     UnlimitedRecordCount != null &&
                     UnlimitedRecordCount.Equals(other.UnlimitedRecordCount)
                     ) &&
                 (
                     CharacterInfos == other.CharacterInfos ||
                     CharacterInfos != null &&
                     other.CharacterInfos != null &&
                     CharacterInfos.SequenceEqual(other.CharacterInfos)
                 ) &&
                 (
                     LastPage == other.LastPage ||
                     LastPage != null &&
                     LastPage.Equals(other.LastPage)
                 ));
        }
Example #2
0
 public CharacterInfo GetCharacterInfo(int charType)
 {
     if (CharacterInfos.ContainsKey(charType))
     {
         return(CharacterInfos[charType]);
     }
     else
     {
         return(DefaultCharacterInfo);
     }
 }
Example #3
0
    void ReadCharacterInfos()
    {
        CharacterInfo.JsonData[] datas;

        TextAsset dataAsset = BundleManager.Instance.GetCharEquipBundleObject(CharacterDataBundleName) as TextAsset;

        datas = JsonConvert.DeserializeObject <CharacterInfo.JsonData[]>(dataAsset.text);

        foreach (var child in datas)
        {
            CharacterInfo info = new CharacterInfo(child);
            CharacterInfos.Add(child.charType, info);
        }
    }
Example #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (UnlimitedRecordCount != null)
         {
             hashCode = hashCode * 59 + UnlimitedRecordCount.GetHashCode();
         }
         if (CharacterInfos != null)
         {
             hashCode = hashCode * 59 + CharacterInfos.GetHashCode();
         }
         if (LastPage != null)
         {
             hashCode = hashCode * 59 + LastPage.GetHashCode();
         }
         return(hashCode);
     }
 }