public CmdSelectRunestone(Player player, SkillType skillType, RunestoneSelectionSource source, RunestoneInstance runestone) { this.m_player = player; this.m_skillType = skillType; this.m_source = source; this.m_runestone = runestone; }
public void postDeserializeInitialization() { for (int i = this.RunestoneInstances.Count - 1; i >= 0; i--) { if (((this.RunestoneInstances[i] == null) || string.IsNullOrEmpty(this.RunestoneInstances[i].Id)) || (ConfigRunestones.GetRunestoneData(this.RunestoneInstances[i].Id) == null)) { this.RunestoneInstances.RemoveAt(i); } } IEnumerator enumerator = Enum.GetValues(typeof(RunestoneSelectionSource)).GetEnumerator(); try { while (enumerator.MoveNext()) { RunestoneSelectionSource current = (RunestoneSelectionSource)((int)enumerator.Current); if (current != RunestoneSelectionSource.None) { for (int m = 0; m < ConfigSkills.ACTIVE_HERO_SKILLS.Count; m++) { bool flag = false; SkillType type = ConfigSkills.ACTIVE_HERO_SKILLS[m]; for (int n = this.SelectedRunestones.Count - 1; n >= 0; n--) { RunestoneSelection selection = this.SelectedRunestones[n]; if ((type == ConfigRunestones.GetSkillTypeForRunestone(selection.Id)) && (current == selection.Source)) { if (flag) { this.SelectedRunestones.RemoveAt(n); } flag = true; } } } } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable == null) { } disposable.Dispose(); } this.refreshRunestoneSelections(); for (int j = 0; j < this.RunestoneInstances.Count; j++) { this.RunestoneInstances[j].postDeserializeInitialization(); } for (int k = 0; k < this.SelectedRunestones.Count; k++) { this.SelectedRunestones[k].postDeserializeInitialization(); } }
public bool isRunestoneSelected(string runestoneId, RunestoneSelectionSource source) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { RunestoneSelection selection = this.SelectedRunestones[i]; if ((selection.Id == runestoneId) && (selection.Source == source)) { return(true); } } return(false); }
public string getSelectedRunestoneId(SkillType skillType, RunestoneSelectionSource source) { if (skillType != SkillType.NONE) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { RunestoneSelection selection = this.SelectedRunestones[i]; if ((skillType == ConfigRunestones.GetSkillTypeForRunestone(selection.Id)) && (source == selection.Source)) { return(selection.Id); } } } return(null); }
public List <RunestoneSelection> getRunestoneSelectionsForSkillType(SkillType skillType, [Optional, DefaultParameterValue(0)] RunestoneSelectionSource source) { sm_tempList.Clear(); if (skillType != SkillType.NONE) { for (int i = 0; i < this.SelectedRunestones.Count; i++) { RunestoneSelection item = this.SelectedRunestones[i]; if (((source == RunestoneSelectionSource.None) || (item.Source == source)) && (skillType == ConfigRunestones.GetSkillTypeForRunestone(item.Id))) { sm_tempList.Add(item); } } } return(sm_tempList); }