RuneHive-Game
Loading...
Searching...
No Matches
InterfaceWriter.java
Go to the documentation of this file.
1
package
com.runehive.content.writer;
2
3
import
com.runehive.net.packet.out.SendColor;
4
import
com.runehive.net.packet.out.SendFont;
5
import
com.runehive.net.packet.out.SendString;
6
import
com.runehive.game.world.entity.mob.player.Player;
7
8
/**
9
* Handles writing on an itemcontainer.
10
*
11
* @author Daniel
12
*
13
*/
14
public
abstract
class
InterfaceWriter
{
15
16
public
InterfaceWriter
(
Player
player
) {
17
this.player =
player
;
18
}
19
20
protected
Player
player
;
21
22
protected
abstract
int
startingIndex
();
23
24
protected
abstract
String[]
text
();
25
26
protected
abstract
int
[][]
color
();
27
28
protected
abstract
int
[][]
font
();
29
30
public
void
scroll
() {
31
32
}
33
34
public
static
void
write
(
InterfaceWriter
writer
) {
35
writer
.scroll();
36
37
/* Sends the text */
38
int
line =
writer
.startingIndex();
39
if
(
writer
.text() !=
null
) {
40
for
(
int
index = 0; index <
writer
.text().length; index++) {
41
writer
.player.send(
new
SendString
(
writer
.text()[index], line++));
42
}
43
}
44
45
/* Sends the color */
46
if
(
writer
.color() !=
null
) {
47
for
(
int
index = 0; index <
writer
.color().length; index++) {
48
writer
.player.send(
new
SendColor
(
writer
.color()[index][0],
writer
.color()[index][1]));
49
}
50
}
51
52
/* Sends the font */
53
if
(
writer
.font() !=
null
) {
54
for
(
int
index = 0; index <
writer
.font().length; index++) {
55
writer
.player.send(
new
SendFont
(
writer
.font()[index][0],
writer
.font()[index][1]));
56
}
57
}
58
}
59
60
}
com.runehive.content.writer.InterfaceWriter.scroll
void scroll()
Definition
InterfaceWriter.java:30
com.runehive.content.writer.InterfaceWriter.text
abstract String[] text()
com.runehive.content.writer.InterfaceWriter.player
Player player
Definition
InterfaceWriter.java:20
com.runehive.content.writer.InterfaceWriter.InterfaceWriter
InterfaceWriter(Player player)
Definition
InterfaceWriter.java:16
com.runehive.content.writer.InterfaceWriter.font
abstract int[][] font()
com.runehive.content.writer.InterfaceWriter.color
abstract int[][] color()
com.runehive.content.writer.InterfaceWriter.startingIndex
abstract int startingIndex()
com.runehive.content.writer.InterfaceWriter.write
static void write(InterfaceWriter writer)
Definition
InterfaceWriter.java:34
com.runehive.game.world.entity.mob.player.Player
This class represents a character controlled by a player.
Definition
Player.java:125
com.runehive.net.packet.out.SendColor
The OutgoingPacket that sends a color to a string in the client.
Definition
SendColor.java:14
com.runehive.net.packet.out.SendFont
The OutgoingPacket that sends a font to a string in the client.
Definition
SendFont.java:14
com.runehive.net.packet.out.SendString
The OutgoingPacket that sends a string to a Players itemcontainer in the client.
Definition
SendString.java:14
com.runehive.content.writer