GameplayManager

The GameplayManager class manages the coordination, assignment, and interaction of players and teams within the game. It provides methods for team creation, player management, and team-player relationships.

Properties

Link copied to clipboard
List of all teams in the game

Functions

Link copied to clipboard
open fun addPlayerToTeam(player: ModPlayer, newTeam: Team)
Adds a player to a specified team, handling their removal from any previous team.
Link copied to clipboard
open fun createTeam(name: String, maxPlayers: Int, color: ChatFormatting)
Creates a new team with specified parameters.
Link copied to clipboard
open fun deleteTeam(team: Team)
Deletes a team and properly handles removal of all its players.
Link copied to clipboard
open fun getPlayerObject(player: ServerPlayer): ModPlayer
Retrieves the ModPlayers object associated with a ServerPlayer.
Link copied to clipboard
open fun onPlayerJoin(player: ServerPlayer)
Handles player join event by creating a new ModPlayers object and assigning them to a team.
Link copied to clipboard
open fun onPlayerLeave(player: ServerPlayer)
Handles player leave event by removing them from their team and the player list.
Link copied to clipboard
Removes a player from their current team.
Link copied to clipboard
open fun teamWithLowestCount(teamList: ArrayList<Team>): Team
Finds the team with the lowest number of players.