generated from BONNePlayground/.github
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect all GameMode addons where VisitAddon is enabled.
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/main/java/world/bentobox/visit/managers/VisitAddonManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package world.bentobox.visit.managers; | ||
|
||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import world.bentobox.bentobox.api.addons.GameModeAddon; | ||
import world.bentobox.visit.VisitAddon; | ||
|
||
|
||
/** | ||
* This class manages data handling and option processing for Visit Addon. | ||
*/ | ||
public class VisitAddonManager | ||
{ | ||
// --------------------------------------------------------------------- | ||
// Section: Variables | ||
// --------------------------------------------------------------------- | ||
|
||
/** | ||
* Local variable that stores all GameMode addons where current addon is enabled. | ||
*/ | ||
private final List<GameModeAddon> enabledAddonList; | ||
|
||
/** | ||
* Reference to main addon class. | ||
*/ | ||
private final VisitAddon addon; | ||
|
||
// --------------------------------------------------------------------- | ||
// Section: Constructors | ||
// --------------------------------------------------------------------- | ||
|
||
|
||
/** | ||
* Constructor VisitAddonManager creates a new VisitAddonManager instance. | ||
* | ||
* @param addon of type VisitAddon | ||
*/ | ||
public VisitAddonManager(VisitAddon addon) | ||
{ | ||
this.addon = addon; | ||
this.enabledAddonList = new ArrayList<>(5); | ||
} | ||
|
||
|
||
// --------------------------------------------------------------------- | ||
// Section: Methods | ||
// --------------------------------------------------------------------- | ||
|
||
|
||
/** | ||
* This method adds given gamemode to the enabled addon list. | ||
* @param addon Addon that must be added to enabled addon list. | ||
*/ | ||
public void addGameMode(GameModeAddon addon) | ||
{ | ||
this.enabledAddonList.add(addon); | ||
} | ||
|
||
|
||
/** | ||
* This method returns the enabledAddonList value. | ||
* @return the value of enabledAddonList. | ||
*/ | ||
public List<GameModeAddon> getEnabledAddonList() | ||
{ | ||
return enabledAddonList; | ||
} | ||
|
||
|
||
// --------------------------------------------------------------------- | ||
// Section: Database methods | ||
// --------------------------------------------------------------------- | ||
|
||
|
||
|
||
} |