Skip to content

Commit

Permalink
finish renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Sep 12, 2023
1 parent c32bfca commit 9d88452
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions main/src/main/java/com/github/topi314/lavasearch/SearchManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@

public class SearchManager {

private final List<AudioSearchManager> sourceManagers;
private final List<AudioSearchManager> searchManagers;

public SearchManager() {
this.sourceManagers = new ArrayList<>();
this.searchManagers = new ArrayList<>();
}

public void registerSourceManager(AudioSearchManager sourceManager) {
sourceManagers.add(sourceManager);
public void registerSearchManager(AudioSearchManager sourceManager) {
searchManagers.add(sourceManager);
}

@Nullable
public <T extends AudioSearchManager> T source(Class<T> klass) {
for (var sourceManager : sourceManagers) {
public <T extends AudioSearchManager> T search(Class<T> klass) {
for (var sourceManager : searchManagers) {
if (klass.isAssignableFrom(sourceManager.getClass())) {
return klass.cast(sourceManager);
}
Expand All @@ -30,19 +30,19 @@ public <T extends AudioSearchManager> T source(Class<T> klass) {
return null;
}

public List<AudioSearchManager> getSourceManagers() {
return this.sourceManagers;
public List<AudioSearchManager> getSearchManagers() {
return this.searchManagers;
}

public void shutdown() {
for (var sourceManager : this.sourceManagers) {
for (var sourceManager : this.searchManagers) {
sourceManager.shutdown();
}
}

@Nullable
public AudioSearchResult loadSearch(String query, Set<AudioSearchResult.Type> types) {
for (var sourceManager : this.sourceManagers) {
for (var sourceManager : this.searchManagers) {
var searchResults = sourceManager.loadSearch(query, types);
if (searchResults != null) {
return searchResults;
Expand Down

0 comments on commit 9d88452

Please sign in to comment.