1package com.runehive.content.dialogue.impl;
3import com.runehive.content.clanchannel.ClanMember;
4import com.runehive.content.clanchannel.ClanRank;
5import com.runehive.content.clanchannel.channel.ClanChannel;
6import com.runehive.content.dialogue.Dialogue;
7import com.runehive.content.dialogue.DialogueFactory;
8import com.runehive.game.world.entity.mob.player.Player;
9import com.runehive.net.packet.out.SendMessage;
20 if (playerMember ==
null || !channel.
canManage(playerMember)) {
21 player.
send(
new SendMessage(
"You do not have the required rank to do this."));
28 setRank(player, channel, member, ClanRank.RECRUIT);
29 }),
"Corporal", () -> factory.
onAction(() -> {
30 setRank(player, channel, member, ClanRank.CORPORAL);
31 }),
"Sergeant", () -> factory.
onAction(() -> {
32 setRank(player, channel, member, ClanRank.SERGEANT);
33 }),
"Lieutenant", () -> factory.
onAction(() -> {
34 setRank(player, channel, member, ClanRank.LIEUTENANT);
36 factory.onAction(() -> {
37 factory.sendOption(
"Captain", () -> factory.onAction(() -> {
38 setRank(player, player.clanChannel, member, ClanRank.CAPTAIN);
39 }),
"General", () -> factory.onAction(() -> {
40 setRank(player, player.clanChannel, member, ClanRank.GENERAL);
41 }),
"Nevermind", () -> factory.onAction(factory::clear));
Handles the clan channel member.
final String name
The name of the clan member.
Handles the clan chat channel.
Optional< ClanMember > getMember(String name)
void setRank(ClanMember member, ClanRank rank)
boolean canManage(ClanMember member)
Represents a factory class that contains important functions for building dialogues.
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory onAction(Runnable action)
Sets an action so this action can be executed after dialogues are done.
Player getPlayer()
The player that owns this factory.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
final DialogueFactory sendOption(String option1, Runnable action1, String option2, Runnable action2)
Appends the OptionDialogue onto the current dialogue chain.
Represents an abstract dialogue, in which extending classes will be able to construct and send dialog...
void sendDialogues(DialogueFactory factory)
Sends a player a dialogue.
void setRank(Player player, ClanChannel channel, ClanMember member, ClanRank rank)
final GenericAttributes attributes
void close(int interfaceId)
This class represents a character controlled by a player.
String getName()
Gets the name of this entity.
DialogueFactory dialogueFactory
final InterfaceManager interfaceManager
void send(OutgoingPacket encoder)
The OutgoingPacket that sends a message to a Players chatbox in the client.
public< K, E > E get(K key)
Gets a generic attribute.
The enum containing all the rank's data within a clan channel.
final String name
The name of the clan rank.