public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return(false);
        }
        DoubleUIntKeyTable <T> rhs = obj as DoubleUIntKeyTable <T>;

        if (rhs == null)
        {
            return(false);
        }
        if (GetCount() != rhs.GetCount())
        {
            return(false);
        }
        bool isEqual = true;

        ForEachDoubleKeyValue(delegate(uint key1, uint key2, T value1)
        {
            T val   = rhs.Get(key1, key2);
            isEqual = (isEqual && value1.Equals(val));
        });
        return(isEqual);
    }
예제 #2
0
    public static DoubleUIntKeyTable <T> CreateDoubleUIntKeyTable <T>(string text, CallBackDoubleUIntKeyReadCSV <T> cb, string name_table, CallBackDoubleUIntSecondKey cb_second_key, CallBackDoubleUIntParseKey cb_parse_first_key = null, CallBackDoubleUIntParseKey cb_parse_second_key = null, Progress progress = null) where T : new()
    {
        DoubleUIntKeyTable <T> doubleUIntKeyTable = new DoubleUIntKeyTable <T>();
        int       num       = 0;
        CSVReader cSVReader = new CSVReader(text, name_table, false);
        float     num2      = 1f;

        if (progress != null)
        {
            num2 = progress.value;
        }
        float num3 = 1f - num2;
        float num4 = (float)text.Length;

        while (cSVReader.NextLine())
        {
            string value  = string.Empty;
            string value2 = string.Empty;
            uint   key    = 0u;
            cSVReader.Pop(ref value);
            if (!string.IsNullOrEmpty(value))
            {
                key = (cb_parse_first_key?.Invoke(value) ?? uint.Parse(value));
                if (cb_second_key != null)
                {
                    num    = (((UIntKeyTable <UIntKeyTable <T> >)doubleUIntKeyTable).Get(key)?.GetCount() ?? 0);
                    value2 = cb_second_key(cSVReader, num);
                }
                else
                {
                    cSVReader.Pop(ref value2);
                }
                if (!string.IsNullOrEmpty(value2))
                {
                    uint key2 = 0u;
                    key2 = (cb_parse_second_key?.Invoke(value2) ?? uint.Parse(value2));
                    T val = new T();
                    if (!cb(cSVReader, val, ref key, ref key2))
                    {
                        doubleUIntKeyTable.Clear();
                        return(null);
                    }
                    UIntKeyTable <T> uIntKeyTable = ((UIntKeyTable <UIntKeyTable <T> >)doubleUIntKeyTable).Get(key);
                    if (uIntKeyTable == null)
                    {
                        uIntKeyTable = new UIntKeyTable <T>(false);
                        ((UIntKeyTable <UIntKeyTable <T> >)doubleUIntKeyTable).Add(key, uIntKeyTable);
                    }
                    uIntKeyTable.Add(key2, val);
                    if (progress != null)
                    {
                        progress.value = num2 + num3 * (float)cSVReader.GetPosition() / num4;
                    }
                }
            }
        }
        return(doubleUIntKeyTable);
    }
예제 #3
0
    public static DoubleUIntKeyTable <T> CreateDoubleUIntKeyTableFromBinary <T>(MemoryStream stream) where T : IDoubleUIntKeyBinaryTableData, new()
    {
        DoubleUIntKeyTable <T> doubleUIntKeyTable = new DoubleUIntKeyTable <T>();
        BinaryTableReader      binaryTableReader  = new BinaryTableReader(stream);

        while (binaryTableReader.MoveNext())
        {
            uint key   = binaryTableReader.ReadUInt32(0u);
            uint key2  = binaryTableReader.ReadUInt32(0u);
            T    value = new T();
            value.LoadFromBinary(binaryTableReader, ref key, ref key2);
            doubleUIntKeyTable.Add(key, key2, value);
        }
        return(doubleUIntKeyTable);
    }
 public void AddTableFromAPI(uint itemId, List <int> questIds)
 {
     if (itemToQuestTable == null)
     {
         itemToQuestTable = new DoubleUIntKeyTable <ItemToQuestData>();
     }
     itemToQuestTable.Get(itemId)?.Clear();
     for (int i = 0; i < questIds.Count; i++)
     {
         ItemToQuestData itemToQuestData = new ItemToQuestData();
         itemToQuestData.LoadFromAPI(itemId, (uint)questIds[i], (uint)i);
         itemToQuestTable.Add(itemId, (uint)i, itemToQuestData);
     }
     InitDependencyData();
 }
    public static DoubleUIntKeyTable <GrowEquipItemNeedItemData> CreateNeedTableBinary(byte[] bytes)
    {
        DoubleUIntKeyTable <GrowEquipItemNeedItemData> doubleUIntKeyTable = new DoubleUIntKeyTable <GrowEquipItemNeedItemData>();
        BinaryTableReader binaryTableReader = new BinaryTableReader(bytes);

        while (binaryTableReader.MoveNext())
        {
            uint key  = binaryTableReader.ReadUInt32(0u);
            uint key2 = binaryTableReader.ReadUInt32(0u);
            GrowEquipItemNeedItemData growEquipItemNeedItemData = new GrowEquipItemNeedItemData();
            growEquipItemNeedItemData.LoadFromBinary(binaryTableReader, ref key, ref key2);
            doubleUIntKeyTable.Add(key, key2, growEquipItemNeedItemData);
        }
        return(doubleUIntKeyTable);
    }
예제 #6
0
    public static bool AddDoubleUIntKeyTable <T>(DoubleUIntKeyTable <T> table1, string text, CallBackDoubleUIntKeyReadCSV <T> cb, string name_table, CallBackDoubleUIntSecondKey cb_second_key, CallBackDoubleUIntParseKey cb_parse_first_key = null, CallBackDoubleUIntParseKey cb_parse_second_key = null) where T : new()
    {
        CSVReader cSVReader = new CSVReader(text, name_table, false);
        int       num       = 0;

        while (cSVReader.NextLine())
        {
            string value  = string.Empty;
            string value2 = string.Empty;
            uint   key    = 0u;
            cSVReader.Pop(ref value);
            if (!string.IsNullOrEmpty(value))
            {
                key = (cb_parse_first_key?.Invoke(value) ?? uint.Parse(value));
                if (cb_second_key != null)
                {
                    num    = (((UIntKeyTable <UIntKeyTable <T> >)table1).Get(key)?.GetCount() ?? 0);
                    value2 = cb_second_key(cSVReader, num);
                }
                else
                {
                    cSVReader.Pop(ref value2);
                }
                if (!string.IsNullOrEmpty(value2))
                {
                    uint key2 = 0u;
                    key2 = (cb_parse_second_key?.Invoke(value2) ?? uint.Parse(value2));
                    T val = new T();
                    if (!cb(cSVReader, val, ref key, ref key2))
                    {
                        return(false);
                    }
                    UIntKeyTable <T> uIntKeyTable = ((UIntKeyTable <UIntKeyTable <T> >)table1).Get(key);
                    if (uIntKeyTable == null)
                    {
                        uIntKeyTable = new UIntKeyTable <T>(false);
                        ((UIntKeyTable <UIntKeyTable <T> >)table1).Add(key, uIntKeyTable);
                    }
                    uIntKeyTable.Add(key2, val);
                }
            }
        }
        return(true);
    }
    public static DoubleUIntKeyTable <AbilityData> CreateTableBinary(byte[] bytes)
    {
        DoubleUIntKeyTable <AbilityData> doubleUIntKeyTable = new DoubleUIntKeyTable <AbilityData>();
        BinaryTableReader binaryTableReader = new BinaryTableReader(bytes);

        while (binaryTableReader.MoveNext())
        {
            uint key  = binaryTableReader.ReadUInt32(0u);
            uint key2 = 0u;
            UIntKeyTable <AbilityData> uIntKeyTable = doubleUIntKeyTable.Get(key);
            if (uIntKeyTable != null)
            {
                key2 = (uint)uIntKeyTable.GetCount();
            }
            AbilityData abilityData = new AbilityData();
            abilityData.LoadFromBinary(binaryTableReader, ref key, ref key2);
            doubleUIntKeyTable.Add(key, key2, abilityData);
        }
        return(doubleUIntKeyTable);
    }
예제 #8
0
 public void CreateTable(string csv_text)
 {
     tableData = TableUtility.CreateDoubleUIntKeyTable <EquipItemExceedParam>(csv_text, EquipItemExceedParam.cb, "exceedId,cnt,atk,def,hp,fireAtk,waterAtk,thunderAtk,earthAtk,lightAtk,darkAtk,fireDef,waterDef,thunderDef,earthDef,lightDef,darkDef,skillType,abilityId,abilityPoint", null, null, null, null);
     tableData.TrimExcess();
 }
 public void CreateTable(string csv_text)
 {
     questToItemTable = TableUtility.CreateDoubleUIntKeyTable <QuestToFieldData>(csv_text, QuestToFieldData.cb, "questId,mapId,eventId", QuestToFieldData.CBSecondKey, null, null, null);
     questToItemTable.TrimExcess();
 }
예제 #10
0
 public void CreateTable(string csv_text)
 {
     tableData = TableUtility.CreateDoubleUIntKeyTable <DeliveryRewardData>(csv_text, DeliveryRewardData.cb, "id,type,itemId,num,param_0", DeliveryRewardData.CBSecondKey, null, null, null);
     tableData.TrimExcess();
 }
예제 #11
0
 public void CreateTable(string csv_text, TableUtility.Progress progress)
 {
     growSkillItemTable = TableUtility.CreateDoubleUIntKeyTable <GrowSkillItemData>(csv_text, GrowSkillItemData.cb, "growId,level,exceedCnt,needExpRate,needExpAdd,giveExpRate,giveExpAdd,atkRate,atkAdd,defRate,defAdd,hpRate,hpAdd,fireAtkRate,fireAtkAdd,waterAtkRate,waterAtkAdd,thunderAtkRate,thunderAtkAdd,earthAtkRate,earthAtkAdd,lightAtkRate,lightAtkAdd,darkAtkRate,darkAtkAdd,fireDefRate,fireDefAdd,waterDefRate,waterDefAdd,thunderDefRate,thunderDefAdd,earthDefRate,earthDefAdd,lightDefRate,lightDefAdd,darkDefRate,darkDefAdd,skillAtkRate,skillAtkAdd,skillAtkRateRate,skillAtkRateAdd,healRate,healAdd,supportValueRate1,supportValueAdd1,supportTimeRate1,supportTimeAdd1,supportValueRate2,supportValueAdd2,supportTimeRate2,supportTimeAdd2,supportValueRate3,supportValueAdd3,supportTimeRate3,supportTimeAdd3,castTimeRate,castTimeAdd,useGaugeRate,useGaugeAdd", null, null, null, progress);
     growSkillItemTable.TrimExcess();
 }
예제 #12
0
 public void CreateTable(string csv_text)
 {
     tableData = TableUtility.CreateDoubleUIntKeyTable <EquipItemExceedData>(csv_text, EquipItemExceedData.cb, "rarity,type,eventId,exchangeItemId,exchangeMoney,exceedItemId0,exceedNum0_1,exceedNum0_2,exceedNum0_3,exceedNum0_4,exceedItemId1,exceedNum1_1,exceedNum1_2,exceedNum1_3,exceedNum1_4,exceedItemId2,exceedNum2_1,exceedNum2_2,exceedNum2_3,exceedNum2_4,exceedItemId3,exceedNum3_1,exceedNum3_2,exceedNum3_3,exceedNum3_4,exceedItemId4,exceedNum4_1,exceedNum4_2,exceedNum4_3,exceedNum4_4", EquipItemExceedData.cb_second_key, EquipItemExceedData.cb_parse_first_key, null, null);
     tableData.TrimExcess();
 }
 public void CreateNeedUniqueTable(string csv_text)
 {
     needUniqueTableData = TableUtility.CreateDoubleUIntKeyTable <GrowEquipItemNeedItemData>(csv_text, GrowEquipItemNeedItemData.cb, "needId,level,itemID_0,itemNum_0,itemID_1,itemNum_1,itemID_2,itemNum_2,itemID_3,itemNum_3,itemID_4,itemNum_4,itemID_5,itemNum_5,itemID_6,itemNum_6,itemID_7,itemNum_7,itemID_8,itemNum_8,itemID_9,itemNum_9,money", null, null, null, null);
 }
 public void CreateTable(byte[] bytes)
 {
     itemToQuestTable = CreateTableBinary(bytes);
 }
 public void CreateGrowTable(byte[] bytes)
 {
     growTableData = CreateGrowTableBinary(bytes);
 }
 public void CreateNeedTable(string csv_text)
 {
     needTableData = CreateNeedTableCSV(csv_text);
 }
 public void CreateGrowTable(string csv_text)
 {
     growTableData = CreateGrowTableCSV(csv_text);
 }
예제 #18
0
 public void CreateTable(string csv_text)
 {
     growTableData = TableUtility.CreateDoubleUIntKeyTable <GrowEnemyData>(csv_text, GrowEnemyData.cb, "growId,lv,hp,atk", null, null, null, null);
     growTableData.TrimExcess();
 }
 public void CreateTable(string csv_text)
 {
     itemToQuestTable = CreateTableCSV(csv_text);
 }
예제 #20
0
 public void CreateTable(string csv_text)
 {
     itemToFieldTable = TableUtility.CreateDoubleUIntKeyTable <ItemToFieldData>(csv_text, ItemToFieldData.cb, "itemId,fieldId,enemyId_0,enemyId_1,enemyId_2,enemyId_3,enemyId_4,pointId_0,pointId_1,pointId_2,pointId_3,pointId_4", ItemToFieldData.CBSecondKey, null, null, null);
     itemToFieldTable.TrimExcess();
 }
 public void CreateTable(string csv_text, TableUtility.Progress progress)
 {
     itemToQuestTable = TableUtility.CreateDoubleUIntKeyTable <ItemToQuestData>(csv_text, ItemToQuestData.cb, "itemId,questId", ItemToQuestData.CBSecondKey, null, null, progress);
 }
 public void CreateTable(string csv_text)
 {
     abilityDataTable = CreateTableCSV(csv_text);
     abilityDataTable.TrimExcess();
 }
 public void CreateNeedTable(byte[] bytes)
 {
     needTableData = CreateNeedTableBinary(bytes);
 }
 public void CreateTable(byte[] bytes)
 {
     abilityDataTable = CreateTableBinary(bytes);
 }
 public void CreateNeedTable(MemoryStream stream)
 {
     needTableData = TableUtility.CreateDoubleUIntKeyTableFromBinary <GrowEquipItemNeedItemData>(stream);
 }