Class RequestManager

java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.managers.RequestManager

public final class RequestManager extends Object
Author:
phaed
  • Constructor Details

    • RequestManager

      public RequestManager()
  • Method Details

    • hasRequest

      public boolean hasRequest(String tag)
    • addDemoteRequest

      public void addDemoteRequest(ClanPlayer requester, String demotedName, Clan clan)
    • 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 request
      request - the type of request, see: ClanRequest
      target - the target which will be used in request processing
      key - the language key that would be translated and send the message to all leaders
      args - the language objects, requires in some language strings.
      Throws:
      IllegalArgumentException - if passed incompatible request
    • addInviteRequest

      public void addInviteRequest(ClanPlayer requester, String invitedName, Clan clan)
      Add a member invite request
      Parameters:
      requester - the requester
      invitedName - the invited Player
      clan - the Clan
    • addWarStartRequest

      public void addWarStartRequest(ClanPlayer requester, Clan warClan, Clan requestingClan)
    • addWarEndRequest

      public void addWarEndRequest(ClanPlayer requester, Clan warClan, Clan requestingClan)
    • addAllyRequest

      public void addAllyRequest(ClanPlayer requester, Clan allyClan, Clan requestingClan)
    • addRivalryBreakRequest

      public void addRivalryBreakRequest(ClanPlayer requester, Clan rivalClan, Clan requestingClan)
    • accept

      public void accept(ClanPlayer cp)
    • deny

      public void deny(ClanPlayer cp)
    • processInvite

      public void processInvite(Request req, VoteResult vote)
    • processResults

      public void processResults(Request req)
    • endPendingRequest

      public void endPendingRequest(String playerName)
      End a pending request prematurely
      Parameters:
      playerName - the Player signing off
    • removeRequest

      public void removeRequest(@NotNull @NotNull String keyOrTarget)
    • askerTask

      public void askerTask()
      Starts the task that asks for the votes of all requests
    • ask

      public void ask(Request req)
      Asks a request to players for votes
      Parameters:
      req - the Request