/// <summary> /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is false. /// </summary> public override void PreProcess( GameList games, GameDB db ) { base.PreProcess( games, db ); if( RemoveOtherGenres ) { SortedSet<string> genreStrings = db.GetAllGenres(); genreCategories = new SortedSet<Category>(); foreach( string cStr in genreStrings ) { if( games.CategoryExists( String.IsNullOrEmpty( Prefix ) ? ( cStr ) : ( Prefix + cStr ) ) && !IgnoredGenres.Contains( cStr ) ) { genreCategories.Add( games.GetCategory( cStr ) ); } } } }
/// <summary> /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is false. /// </summary> public override void PreProcess( GameList games, GameDB db ) { base.PreProcess( games, db ); if( removeOtherGenres ) { SortedSet<string> catStrings = new SortedSet<string>(); char[] sep = new char[] { ',' }; foreach( GameDBEntry dbEntry in db.Games.Values ) { if( !String.IsNullOrEmpty( dbEntry.Genre ) ) { string[] cats = dbEntry.Genre.Split( sep ); foreach( string cStr in cats ) { catStrings.Add( cStr.Trim() ); } } } genreCategories = new SortedSet<Category>(); foreach( string cStr in catStrings ) { if( games.CategoryExists( cStr ) ) { genreCategories.Add( games.GetCategory( cStr ) ); } } } }