Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package game.player.dialogue;
- import java.util.HashMap;
- import java.util.Optional;
- import game.npc.NPC;
- import game.npc.NPCHandler;
- import game.npc.boss.Boss;
- import game.player.Client;
- import game.player.Player;
- import game.player.dialogue.impl.Test;
- /**
- * @author Trystan/Andrew
- *
- * @since 2/8/2016 4:25 PM
- *
- * @notes Abstract class manging all NPC Dialogues.
- */
- public abstract class NPCDialogue {
- public int dialogueId = 0;
- private static HashMap<Integer, NPCDialogue> map = new HashMap<Integer, NPCDialogue>();
- static {
- map.put(399, new Test());
- map.put(209, new Test());
- }
- public static NPCDialogue forId(int npcType) {
- return map.get(npcType);
- }
- public abstract void handle(Client player, int i);
- public static void sendDialogue(Client player, int i) {
- NPCDialogue npcDialogue = NPCDialogue.forId(i);
- Optional<Player> user = Optional.of(player);
- Optional<NPCDialogue> dialogue = Optional.of(npcDialogue);
- if (!user.isPresent() || !dialogue.isPresent()) {
- return;
- }
- npcDialogue.handle(player, i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement