Class RequestManager
java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.managers.RequestManager
- Author:
- phaed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ClanPlayer cp) voidaddAllyRequest(ClanPlayer requester, Clan allyClan, Clan requestingClan) voidaddDemoteRequest(ClanPlayer requester, String demotedName, Clan clan) voidaddInviteRequest(ClanPlayer requester, String invitedName, Clan clan) Add a member invite requestvoidaddRivalryBreakRequest(ClanPlayer requester, Clan rivalClan, Clan requestingClan) voidaddWarEndRequest(ClanPlayer requester, Clan warClan, Clan requestingClan) voidaddWarStartRequest(ClanPlayer requester, Clan warClan, Clan requestingClan) voidAsks a request to players for votesvoidStarts the task that asks for the votes of all requestsvoiddeny(ClanPlayer cp) voidendPendingRequest(String playerName) End a pending request prematurelybooleanhasRequest(String tag) voidprocessInvite(Request req, VoteResult vote) voidprocessResults(Request req) voidremoveRequest(@NotNull String keyOrTarget) voidrequestAllLeaders(@NotNull ClanPlayer requester, @NotNull ClanRequest request, @NotNull String target, @NotNull String key, @Nullable Object... args) This method asks all leaders about some action inside their clan.
-
Constructor Details
-
RequestManager
public RequestManager()
-
-
Method Details
-
hasRequest
-
addDemoteRequest
-
requestAllLeaders
public void requestAllLeaders(@NotNull @NotNull ClanPlayer requester, @NotNull @NotNull ClanRequest request, @NotNull @NotNull String target, @NotNull @NotNull String key, @Nullable @Nullable Object... args) This method asks all leaders about some action inside their clan.Example of possible requests:
- Disband request can be asked from all leaders
- Rename request can be asked from all leaders
- Promote request can be asked from all leaders
Examples of incompatible requests:
- Demote request can be asked from all leaders, except the demoted one.
- Invite request has to ask someone outside of leaders clan
- Parameters:
requester- the clan player, who sent the requestrequest- the type of request, see:ClanRequesttarget- the target which will be used in request processingkey- the language key that would be translated and send the message to all leadersargs- the language objects, requires in some language strings.- Throws:
IllegalArgumentException- if passed incompatible request
-
addInviteRequest
Add a member invite request- Parameters:
requester- the requesterinvitedName- the invited Playerclan- the Clan
-
addWarStartRequest
-
addWarEndRequest
-
addAllyRequest
-
addRivalryBreakRequest
-
accept
-
deny
-
processInvite
-
processResults
-
endPendingRequest
End a pending request prematurely- Parameters:
playerName- the Player signing off
-
removeRequest
-
askerTask
public void askerTask()Starts the task that asks for the votes of all requests -
ask
Asks a request to players for votes- Parameters:
req- the Request
-