public void ReLoad(IBase obj) { var typevalue = obj.GetType(); FileTypes type = ((TypeDataAttribute)obj.GetType().GetCustomAttributes(typeof(TypeDataAttribute), false)[0]).Type; if (this.Data[type].ContainsKey(obj)) { var baseobj = this.Data[type][obj].Find((item) => item.FileType == type); var lr = this.Data[type][obj]; this.Data[type].Remove(obj); switch (type) { case FileTypes.Level: var Levelresult = ResourceConverter.ResourceToLevel(baseobj, lr); Data[type][Levelresult.Item1] = Levelresult.Item2; break; case FileTypes.Boss: var Bossresult = ResourceConverter.ResourceToBoss(baseobj, lr); Data[type][Bossresult.Item1] = Bossresult.Item2; break; case FileTypes.Question: var Questionesult = ResourceConverter.ResourceToQuestion(baseobj, lr); Data[type][Questionesult.Item1] = Questionesult.Item2; break; case FileTypes.Language: var LanguagePacresult = ResourceConverter.ResourceToLanguagePack(baseobj, lr); Data[type][LanguagePacresult.Item1] = LanguagePacresult.Item2; break; case FileTypes.Age: var Ageresult = ResourceConverter.ResourceToAge(baseobj, lr); Data[type][Ageresult.Item1] = Ageresult.Item2; break; case FileTypes.InventoryItem: var InventoryItemresult = ResourceConverter.ResourceToInventoryItem(baseobj, lr); Data[type][InventoryItemresult.Item1] = InventoryItemresult.Item2; break; case FileTypes.TextStyle: var TextStyleresult = ResourceConverter.ResourceToTextStyle(baseobj, lr); Data[type][TextStyleresult.Item1] = TextStyleresult.Item2; break; } } }
public ResourceFileData(ToePackage pac) { for (int i = 0; i < pac.Items.Count; i++) { pac.Items[i].Data.Position = 0; switch (pac.Items[i].FileType) { case FileTypes.Level: var Levelresult = ResourceConverter.ResourceToLevel(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][Levelresult.Item1] = Levelresult.Item2; break; case FileTypes.Boss: var Bossresult = ResourceConverter.ResourceToBoss(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][Bossresult.Item1] = Bossresult.Item2; break; case FileTypes.Question: var Questionesult = ResourceConverter.ResourceToQuestion(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][Questionesult.Item1] = Questionesult.Item2; break; case FileTypes.Language: var LanguagePacresult = ResourceConverter.ResourceToLanguagePack(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][LanguagePacresult.Item1] = LanguagePacresult.Item2; break; case FileTypes.Age: var Ageresult = ResourceConverter.ResourceToAge(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][Ageresult.Item1] = Ageresult.Item2; break; case FileTypes.InventoryItem: var InventoryItemresult = ResourceConverter.ResourceToInventoryItem(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][InventoryItemresult.Item1] = InventoryItemresult.Item2; break; case FileTypes.TextStyle: var TextStyleresult = ResourceConverter.ResourceToTextStyle(pac.Items[i], pac.Items); Data[pac.Items[i].FileType][TextStyleresult.Item1] = TextStyleresult.Item2; break; } } }