예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
 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);
 }
예제 #4
0
 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;
 }
예제 #5
0
 protected virtual void AddItem(SearchResult sr)
 {
     throw new NotImplementedException();
 }
예제 #6
0
 protected virtual bool IsInAnotherLibrary(SearchResult searchResult,Library current)
 {
     throw new NotImplementedException();
 }
예제 #7
0
 protected virtual bool FoundInLibrary(Library lib, SearchResult searchResult)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 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;
 }
예제 #9
0
 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;
 }