Class TeamManager
java.lang.Object
tk.airshipcraft.commonlib.gui.objects.impl.TeamManager
Provides a centralized management system for teams across different plugins.
This class facilitates the registration, retrieval, and overall management of teams,
offering a common interface for various team operations.
It allows plugins to interact with a unified team structure, simplifying team-related functionalities.
- Since:
- 2023-11-20
- Version:
- 1.0.0
- Author:
- notzune
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a team by its name.void
registerTeam
(ITeam team) Registers a new team with the manager.void
setParentTeam
(String childName, String parentName) Sets the parent team for a given team, establishing a hierarchical relationship.void
unregisterTeam
(String name) Unregisters a team from the manager.
-
Constructor Details
-
TeamManager
public TeamManager()
-
-
Method Details
-
registerTeam
Registers a new team with the manager. If a team with the same name already exists, it will be replaced with the new team.- Parameters:
team
- The ITeam instance representing the team to register.
-
getTeam
Retrieves a team by its name. This method allows for quick access to team information based on the team's name.- Parameters:
name
- The name of the team to retrieve.- Returns:
- The ITeam instance representing the team with the given name, or null if no such team exists.
-
unregisterTeam
Unregisters a team from the manager. This method removes the team from the centralized team management system.- Parameters:
name
- The name of the team to unregister.
-
setParentTeam
Sets the parent team for a given team, establishing a hierarchical relationship. This method is used to create structured team hierarchies, such as sub-teams or divisions.- Parameters:
childName
- The name of the child team.parentName
- The name of the parent team.
-