RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
InterfaceWriter.java
1package com.osroyale.content.writer;
2
3import com.osroyale.net.packet.out.SendColor;
4import com.osroyale.net.packet.out.SendFont;
5import com.osroyale.net.packet.out.SendString;
6import com.osroyale.game.world.entity.mob.player.Player;
7
40
41public abstract class InterfaceWriter {
42
43 public InterfaceWriter(Player player) {
44 this.player = player;
45 }
46
47 protected Player player;
48
49 protected abstract int startingIndex();
50
51 protected abstract String[] text();
52
53 protected abstract int[][] color();
54
55 protected abstract int[][] font();
56
57 public void scroll() {
58
59 }
60
61 public static void write(InterfaceWriter writer) {
62 writer.scroll();
63
64 /* Sends the text */
65 int line = writer.startingIndex();
66 if (writer.text() != null) {
67 for (int index = 0; index < writer.text().length; index++) {
68 writer.player.send(new SendString(writer.text()[index], line++));
69 }
70 }
71
72 /* Sends the color */
73 if (writer.color() != null) {
74 for (int index = 0; index < writer.color().length; index++) {
75 writer.player.send(new SendColor(writer.color()[index][0], writer.color()[index][1]));
76 }
77 }
78
79 /* Sends the font */
80 if (writer.font() != null) {
81 for (int index = 0; index < writer.font().length; index++) {
82 writer.player.send(new SendFont(writer.font()[index][0], writer.font()[index][1]));
83 }
84 }
85 }
86
87}