RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.net.packet.out.SendInputAmount Class Reference

Sends an input dialogue. More...

Inheritance diagram for com.runehive.net.packet.out.SendInputAmount:
Collaboration diagram for com.runehive.net.packet.out.SendInputAmount:

Public Member Functions

boolean encode (Player player)
 SendInputAmount (Consumer< String > action)
 SendInputAmount (String message, int length, Consumer< String > action)
Public Member Functions inherited from com.runehive.net.packet.OutgoingPacket
void execute (Player player)
 OutgoingPacket (int opcode, int capacity)
 OutgoingPacket (int opcode, PacketType type)
 OutgoingPacket (int opcode, PacketType type, int size)

Private Attributes

final Consumer< String > action
final int inputLength
final String inputMessage

Additional Inherited Members

Protected Attributes inherited from com.runehive.net.packet.OutgoingPacket
final PacketBuilder builder

Detailed Description

Sends an input dialogue.

Author
Daniel
Michael

Definition at line 17 of file SendInputAmount.java.

Constructor & Destructor Documentation

◆ SendInputAmount() [1/2]

com.runehive.net.packet.out.SendInputAmount.SendInputAmount ( Consumer< String > action)

Definition at line 23 of file SendInputAmount.java.

23 {
24 this("Enter an amount:", 10, action);
25 }

References action.

◆ SendInputAmount() [2/2]

com.runehive.net.packet.out.SendInputAmount.SendInputAmount ( String message,
int length,
Consumer< String > action )

Definition at line 27 of file SendInputAmount.java.

27 {
28 super(27, PacketType.VAR_SHORT);
29 this.action = action;
30 this.inputMessage = message;
31 this.inputLength = length;
32 }

References action, and com.runehive.net.packet.PacketType.VAR_SHORT.

Member Function Documentation

◆ encode()

boolean com.runehive.net.packet.out.SendInputAmount.encode ( Player player)

Reimplemented from com.runehive.net.packet.OutgoingPacket.

Definition at line 35 of file SendInputAmount.java.

35 {
36 player.enterInputListener = Optional.of(action);
37 builder.writeString(inputMessage)
38 .writeShort(inputLength, ByteModification.ADD);
39 return true;
40 }

References action, com.runehive.net.codec.ByteModification.ADD, com.runehive.net.packet.OutgoingPacket.builder, inputLength, and inputMessage.

Member Data Documentation

◆ action

final Consumer<String> com.runehive.net.packet.out.SendInputAmount.action
private

Definition at line 19 of file SendInputAmount.java.

Referenced by encode(), SendInputAmount(), and SendInputAmount().

◆ inputLength

final int com.runehive.net.packet.out.SendInputAmount.inputLength
private

Definition at line 21 of file SendInputAmount.java.

Referenced by encode().

◆ inputMessage

final String com.runehive.net.packet.out.SendInputAmount.inputMessage
private

Definition at line 20 of file SendInputAmount.java.

Referenced by encode().


The documentation for this class was generated from the following file: