Example #1
0
 protected bool RemoveEntry(LibraryEntry entry)
 {
     bool state = entries.Remove(entry);
     Logger.Info("Removed " + entry.GetType().Name.ToLower() + " " + entry.ToString());
     if (state) { Bestiary.changed = true; }
     return state;
 }
Example #2
0
 protected int AddEntry(LibraryEntry newEntry)
 {
     if (CountOf(newEntry.id) > 0)
     {
         Logger.Warn("Could not add " + newEntry.GetType().Name.ToLower() + " " + newEntry.ToString() + ": ID already exists for " + FindEntry(newEntry.id).ToString());
         throw new System.ArgumentException(GetType().ToString() + " library already contains ID " + newEntry.id, "newEntry");
     }
     else
     {
         entries.Add(newEntry);
         Logger.Info("Added new " + newEntry.GetType().Name.ToLower() + ": " + newEntry.ToString());
         Bestiary.changed = true;
         return newEntry.id;
     }
 }