Class StartCommand
java.lang.Object
fr.multimc.api.spigot.common.commands.executors.StartCommand
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor
Class that implements the
CommandExecutor interface for the "start" command.
Allows for starting a game with specified teams.-
Constructor Summary
ConstructorsConstructorDescriptionStartCommand(@NotNull GamesManager gamesManager, @NotNull TeamManager teamManager) Constructor for the StartCommand class. -
Method Summary
Modifier and TypeMethodDescriptiongetTeams(int teamSize, DispatchAlgorithm dispatchAlgorithm) Creates and dispatch players into teams with a specified team size and dispatch algorithm.booleanonCommand(@NotNull org.bukkit.command.CommandSender commandSender, @NotNull org.bukkit.command.Command command, @NotNull String s, @NotNull String[] args) Executes the "start" command when called.
-
Constructor Details
-
StartCommand
public StartCommand(@NotNull @NotNull GamesManager gamesManager, @NotNull @NotNull TeamManager teamManager) Constructor for the StartCommand class.- Parameters:
gamesManager- TheGamesManagerinstance to be used for starting the game.teamManager- TheTeamManagerinstance to be used for managing teams.
-
-
Method Details
-
onCommand
public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender commandSender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String s, @NotNull @NotNull String[] args) Executes the "start" command when called.- Specified by:
onCommandin interfaceorg.bukkit.command.CommandExecutor- Parameters:
commandSender- TheCommandSenderof the command.command- TheCommandbeing executed.s-Stringthat represents yhe name of the command being executed.args-String[] that represents the additional arguments passed with the command.- Returns:
- boolean indicating if the command was successful or not.
-
getTeams
Creates and dispatch players into teams with a specified team size and dispatch algorithm.- Parameters:
teamSize- The size of each team.dispatchAlgorithm- TheDispatchAlgorithmto be used for dispatching players into teams.- Returns:
- A
List<MmcTeam>with players.
-