Class PartyManager
- java.lang.Object
-
- de.simonsator.partyandfriends.api.party.PartyManager
-
- All Implemented Interfaces:
Deactivated
public abstract class PartyManager extends java.lang.Object implements Deactivated
This class manages the parties.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PartyManager()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addPlayerToParty(OnlinePAFPlayer player, PlayerParty party)
Puts the player with the party in theHashMap
abstract PlayerParty
createParty(OnlinePAFPlayer player)
Creates a party if the player is not already in a party.protected abstract void
deleteAllParties()
abstract void
deleteParty(PlayerParty party)
Deletes a party which is givenstatic PartyManager
getInstance()
PlayerParty
getParty(OnlinePAFPlayer player)
Returns the party in which a player isabstract PlayerParty
getParty(java.util.UUID pUUID)
A player cannot have an party when he is offline.void
onDisable()
abstract void
removePlayerFromParty(PAFPlayer player)
Removes the player party link from theHashMap
-
-
-
Method Detail
-
getInstance
public static PartyManager getInstance()
-
getParty
public PlayerParty getParty(OnlinePAFPlayer player)
Returns the party in which a player is- Parameters:
player
- The player- Returns:
- Returns the party in which a player is or null if he isn't in a party.
-
getParty
public abstract PlayerParty getParty(java.util.UUID pUUID)
A player cannot have an party when he is offline. This is only for the case that the player has left the server before the async disconnect was executed- Parameters:
pUUID
- The uuid of the player- Returns:
- Returns the party of the player, if he has one, else it is returning null.
-
createParty
public abstract PlayerParty createParty(OnlinePAFPlayer player)
Creates a party if the player is not already in a party.- Parameters:
player
- The player- Returns:
- Returns true if the party was created or false if not
-
deleteAllParties
protected abstract void deleteAllParties()
-
deleteParty
public abstract void deleteParty(PlayerParty party)
Deletes a party which is given- Parameters:
party
- The party
-
addPlayerToParty
public abstract void addPlayerToParty(OnlinePAFPlayer player, PlayerParty party)
Puts the player with the party in theHashMap
- Parameters:
player
- The Playerparty
- The Party
-
removePlayerFromParty
public abstract void removePlayerFromParty(PAFPlayer player)
Removes the player party link from theHashMap
- Parameters:
player
- The Player
-
onDisable
public void onDisable()
- Specified by:
onDisable
in interfaceDeactivated
-
-