public void Randomize() { int spellTypeCount = Enum.GetNames(typeof(Enhancements.SpellType)).Length; int spellTypeIndex = Utility.RandomMinMax(0, spellTypeCount - 1); int spellHueTypeCount = Enum.GetNames(typeof(Enhancements.SpellHueType)).Length; int spellHueTypeIndex = Utility.RandomMinMax(1, spellHueTypeCount - 1); m_SpellType = (Enhancements.SpellType)spellTypeIndex; m_SpellHueType = (Enhancements.SpellHueType)spellHueTypeIndex; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); //Version 0 if (version >= 0) { m_SpellType = (Enhancements.SpellType)reader.ReadInt(); m_SpellHueType = (Enhancements.SpellHueType)reader.ReadInt(); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); //Version 0 if (version >= 0) { m_AccountUsername = reader.ReadString(); int customizationCount = reader.ReadInt(); for (int a = 0; a < customizationCount; a++) { Enhancements.CustomizationType customizationType = (Enhancements.CustomizationType)reader.ReadInt(); bool unlocked = reader.ReadBool(); bool active = reader.ReadBool(); Enhancements.CustomizationEntry customization = new Enhancements.CustomizationEntry(customizationType, unlocked, active); m_Customizations.Add(customization); } int spellHuesCount = reader.ReadInt(); for (int a = 0; a < spellHuesCount; a++) { Enhancements.SpellType spellType = (Enhancements.SpellType)reader.ReadInt(); List <Enhancements.SpellHueType> m_SpellHueTypes = new List <Enhancements.SpellHueType>(); int spellHueSpellsCount = reader.ReadInt(); for (int b = 0; b < spellHueSpellsCount; b++) { m_SpellHueTypes.Add((Enhancements.SpellHueType)reader.ReadInt()); } Enhancements.SpellHueType selectedSpellHue = (Enhancements.SpellHueType)reader.ReadInt(); if (spellType != null) { Enhancements.SpellHueEntry spellHueEntry = new Enhancements.SpellHueEntry(spellType); spellHueEntry.m_UnlockedHues = m_SpellHueTypes; spellHueEntry.m_SelectedHue = selectedSpellHue; m_SpellHues.Add(spellHueEntry); } } int emotesCount = reader.ReadInt(); for (int a = 0; a < emotesCount; a++) { Enhancements.EmoteType emoteType = (Enhancements.EmoteType)reader.ReadInt(); bool unlocked = reader.ReadBool(); Enhancements.EmoteEntry emote = new Enhancements.EmoteEntry(emoteType, unlocked); m_Emotes.Add(emote); } } //----- EnhancementsPersistance.m_EnhancementsEntries.Add(this); }