public abstract class NetworkChat extends java.lang.Object implements Networkable, com.b3dgs.lionengine.core.KeyboardListener
Constructor and Description |
---|
NetworkChat(java.lang.Enum<?> type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addNetworkMessage(NetworkMessage message)
Add a message to the queue.
|
void |
applyMessage(NetworkMessage message)
Apply message.
|
void |
clearNetworkMessages()
Clear the network messages list.
|
java.lang.Byte |
getClientId()
Get the client id.
|
java.util.Queue<java.lang.String> |
getMessages()
Get the list of messages.
|
java.util.Collection<NetworkMessage> |
getNetworkMessages()
Get the messages list.
|
java.lang.String |
getWriting()
Get the current writing string.
|
void |
keyPressed(int keyCode,
char keyChar) |
void |
keyReleased(int keyCode,
char keyChar) |
abstract void |
render(com.b3dgs.lionengine.Graphic g)
Render the chat.
|
void |
setClientId(java.lang.Byte id)
Set the client id.
|
void |
setKeyBackSpace(int keyBackSpace)
Set the key that insert a space in a message.
|
void |
setKeyValidate(int keyValidate)
Set the key that allow to validate a message.
|
public NetworkChat(java.lang.Enum<?> type)
type
- The message type enum.public abstract void render(com.b3dgs.lionengine.Graphic g)
g
- The graphic output.public void setKeyValidate(int keyValidate)
keyValidate
- The key that allow to validate a message.public void setKeyBackSpace(int keyBackSpace)
keyBackSpace
- The key that insert a backspace in a message.public java.util.Queue<java.lang.String> getMessages()
public java.lang.String getWriting()
public void addNetworkMessage(NetworkMessage message)
Networkable
addNetworkMessage
in interface Networkable
message
- The message to add.public void applyMessage(NetworkMessage message)
Networkable
applyMessage
in interface Networkable
message
- The message.public java.util.Collection<NetworkMessage> getNetworkMessages()
Networkable
getNetworkMessages
in interface Networkable
public void clearNetworkMessages()
Networkable
clearNetworkMessages
in interface Networkable
public void setClientId(java.lang.Byte id)
Networkable
setClientId
in interface Networkable
id
- The client id.public java.lang.Byte getClientId()
Networkable
getClientId
in interface Networkable
public void keyPressed(int keyCode, char keyChar)
keyPressed
in interface com.b3dgs.lionengine.core.KeyboardListener
public void keyReleased(int keyCode, char keyChar)
keyReleased
in interface com.b3dgs.lionengine.core.KeyboardListener