|
| 1 | +package plugily.projects.minigamesbox.api.arena; |
| 2 | + |
| 3 | +import org.bukkit.Location; |
| 4 | +import org.bukkit.entity.Player; |
| 5 | +import org.jetbrains.annotations.NotNull; |
| 6 | +import org.jetbrains.annotations.Nullable; |
| 7 | +import plugily.projects.minigamesbox.api.IPluginMain; |
| 8 | +import plugily.projects.minigamesbox.api.arena.managers.IBossbarManager; |
| 9 | +import plugily.projects.minigamesbox.api.arena.managers.IPluginMapRestorerManager; |
| 10 | +import plugily.projects.minigamesbox.api.arena.managers.IPluginScoreboardManager; |
| 11 | +import plugily.projects.minigamesbox.api.events.game.PlugilyGameStateChangeEvent; |
| 12 | + |
| 13 | +import java.util.List; |
| 14 | +import java.util.Set; |
| 15 | + |
| 16 | +/** |
| 17 | + * @author Lagggpixel |
| 18 | + * @since April 24, 2024 |
| 19 | + */ |
| 20 | +public interface IPluginArena { |
| 21 | + |
| 22 | + /** |
| 23 | + * Returns whether option value is true or false |
| 24 | + * |
| 25 | + * @param name option to get value from |
| 26 | + * @return true or false based on user configuration |
| 27 | + */ |
| 28 | + Integer getArenaOption(String name); |
| 29 | + |
| 30 | + boolean isReady(); |
| 31 | + |
| 32 | + void setReady(boolean ready); |
| 33 | + |
| 34 | + void setForceStart(boolean forceStart); |
| 35 | + |
| 36 | + /** |
| 37 | + * Returns boss bar of the game. |
| 38 | + * Please use doBarAction if possible |
| 39 | + * |
| 40 | + * @return game boss bar manager |
| 41 | + * @see IBossbarManager |
| 42 | + */ |
| 43 | + IBossbarManager getBossbarManager(); |
| 44 | + |
| 45 | + /** |
| 46 | + * Get arena identifier used to get arenas by string. |
| 47 | + * |
| 48 | + * @return arena name |
| 49 | + * @see IPluginArenaRegistry#getArena(String) |
| 50 | + */ |
| 51 | + String getId(); |
| 52 | + |
| 53 | + int getMinimumPlayers(); |
| 54 | + |
| 55 | + /** |
| 56 | + * Get arena map name. |
| 57 | + * |
| 58 | + * @return arena map name, <b>it's not arena id</b> |
| 59 | + * @see #getId() |
| 60 | + */ |
| 61 | + String getMapName(); |
| 62 | + |
| 63 | + /** |
| 64 | + * Set arena map name. |
| 65 | + * |
| 66 | + * @param mapName new map name, [b]it's not arena id[/b] |
| 67 | + */ |
| 68 | + void setMapName(String mapName); |
| 69 | + |
| 70 | + /** |
| 71 | + * Get timer of arena. |
| 72 | + * |
| 73 | + * @return timer of lobby time / time to next wave |
| 74 | + */ |
| 75 | + int getTimer(); |
| 76 | + |
| 77 | + /** |
| 78 | + * Modify game timer. |
| 79 | + * |
| 80 | + * @param timer timer of lobby / time to next wave |
| 81 | + */ |
| 82 | + void setTimer(int timer); |
| 83 | + |
| 84 | + /** |
| 85 | + * Modify game timer. |
| 86 | + * |
| 87 | + * @param timer timer of lobby / time to next wave |
| 88 | + * @param forceArenaTimer should the timer be forced |
| 89 | + */ |
| 90 | + void setTimer(int timer, boolean forceArenaTimer); |
| 91 | + |
| 92 | + int getMaximumPlayers(); |
| 93 | + |
| 94 | + IPluginMapRestorerManager getMapRestorerManager(); |
| 95 | + |
| 96 | + /** |
| 97 | + * Gets the current arena state |
| 98 | + * @return The current arena state |
| 99 | + */ |
| 100 | + @NotNull IArenaState getArenaState(); |
| 101 | + |
| 102 | + /** |
| 103 | + * Set game state of arena. |
| 104 | + * Calls VillageGameStateChangeEvent |
| 105 | + * |
| 106 | + * @param ArenaState new game state of arena |
| 107 | + * @param forceArenaState should it force the arenaState? |
| 108 | + * @see IArenaState |
| 109 | + * @see PlugilyGameStateChangeEvent |
| 110 | + */ |
| 111 | + void setArenaState(@NotNull IArenaState ArenaState, boolean forceArenaState); |
| 112 | + |
| 113 | + /** |
| 114 | + * Set game state of arena. |
| 115 | + * Calls VillageGameStateChangeEvent |
| 116 | + * |
| 117 | + * @param ArenaState new game state of arena |
| 118 | + * @see IArenaState |
| 119 | + * @see PlugilyGameStateChangeEvent |
| 120 | + */ |
| 121 | + void setArenaState(@NotNull IArenaState ArenaState); |
| 122 | + |
| 123 | + |
| 124 | + /** |
| 125 | + * Gets all the players in the arena |
| 126 | + * @return a set containing all the players |
| 127 | + */ |
| 128 | + @NotNull Set<Player> getPlayers(); |
| 129 | + |
| 130 | + /** |
| 131 | + * Get spectator location of arena. |
| 132 | + * |
| 133 | + * @return end location of arena |
| 134 | + */ |
| 135 | + @Nullable Location getSpectatorLocation(); |
| 136 | + |
| 137 | + /** |
| 138 | + * Set spectator location of arena. |
| 139 | + * |
| 140 | + * @param spectatorLoc new end location of arena |
| 141 | + */ |
| 142 | + void setSpectatorLocation(Location spectatorLoc); |
| 143 | + |
| 144 | + Location getLobbyLocation(); |
| 145 | + |
| 146 | + void setLobbyLocation(Location loc); |
| 147 | + |
| 148 | + Location getStartLocation(); |
| 149 | + |
| 150 | + void setStartLocation(Location location); |
| 151 | + |
| 152 | + void teleportToEndLocation(Player player); |
| 153 | + |
| 154 | + Location getEndLocation(); |
| 155 | + |
| 156 | + Location getLocation(GameLocation gameLocation); |
| 157 | + |
| 158 | + IPluginScoreboardManager getScoreboardManager(); |
| 159 | + |
| 160 | + @NotNull List<Player> getPlayersLeft(); |
| 161 | + |
| 162 | + /** |
| 163 | + * Returns the plugin main class |
| 164 | + * @return plugin main |
| 165 | + */ |
| 166 | + IPluginMain getPlugin(); |
| 167 | + |
| 168 | + enum IBarAction { |
| 169 | + ADD, REMOVE; |
| 170 | + } |
| 171 | + |
| 172 | + enum GameLocation { |
| 173 | + START, LOBBY, END, SPECTATOR |
| 174 | + } |
| 175 | +} |
0 commit comments