protected override bool FoundInLibrary(Library lib, SearchResult searchResult) { bool duplicate = false; SearchResultMonster srm = searchResult as SearchResultMonster; Creature c = lib.FindCreatureCaseInsensitive(srm.Name, Convert.ToInt32(srm.Level)); if (c != null) { if (c.HP == 1) { Minion m = c.Role as Minion; if (m.HasRole) { duplicate = m.Type.ToString() == srm.CombatRole; } } else { ComplexRole cr = c.Role as ComplexRole; duplicate = srm.CombatRole.StartsWith(cr.Type.ToString()) && (cr.Leader == srm.CombatRole.Contains("Leader")) && (cr.Flag.ToString() == srm.GroupRole); } } return duplicate; }
protected override bool FoundInLibrary(Library lib, SearchResult searchResult) { bool duplicate = false; SearchResultTrap srm = searchResult as SearchResultTrap; Trap c = lib.FindTrapCaseInsensitive(srm.Name, Convert.ToInt32(srm.Level)); if (c != null) { duplicate = false; } return duplicate; }
protected override void AddItem(SearchResult sr) { ListViewItem lvi = new ListViewItem(); lvi.Text = sr.Name; lvi.Tag = sr; lvi.SubItems.Add((sr as SearchResultMonster).Level.ToString()); lvi.SubItems.Add((sr as SearchResultMonster).CombatRole); lvi.SubItems.Add((sr as SearchResultMonster).GroupRole); lvi.SubItems.Add(sr.SourceBookReduced); lvi.Checked = true; lvi.ToolTipText = sr.SourceBook; lvwResults.Items.Add(lvi); }
protected override bool IsInAnotherLibrary(SearchResult searchResult,Library current) { bool duplicate = false; SearchResultMagicItem srm = searchResult as SearchResultMagicItem; foreach (Library lib in _mpApp.Libraries) { if (lib.ID==current.ID) continue; MagicItem c = lib.FindMagicItem(srm.Name); if (c != null) { duplicate = true; } } return duplicate; }
protected virtual void AddItem(SearchResult sr) { throw new NotImplementedException(); }
protected virtual bool IsInAnotherLibrary(SearchResult searchResult,Library current) { throw new NotImplementedException(); }
protected virtual bool FoundInLibrary(Library lib, SearchResult searchResult) { throw new NotImplementedException(); }
protected override bool IsInAnotherLibrary(SearchResult searchResult, Library current) { bool duplicate = false; SearchResultMonster srm = searchResult as SearchResultMonster; foreach (Library lib in _mpApp.Libraries) { if (lib.ID == current.ID) continue; duplicate = FoundInLibrary(lib, searchResult); if (duplicate) break; } return duplicate; }
protected override bool IsInAnotherLibrary(SearchResult searchResult, Library current) { bool duplicate = false; SearchResultTrap srm = searchResult as SearchResultTrap; foreach (Library lib in _mpApp.Libraries) { if (lib.ID == current.ID) continue; Trap c = lib.FindTrap(srm.Name, Convert.ToInt32(srm.Level), srm.Role); if (c != null) { duplicate = true; } } return duplicate; }