public class ChatBox
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private java.util.List<ChatMessage> |
messages |
private static long |
serialVersionUID |
Constructor and Description |
---|
ChatBox()
Default constructor; initializes message list
|
Modifier and Type | Method and Description |
---|---|
ChatMessage |
get(int i)
Get a chat message
|
int |
lastChatter()
Gets the index of the last player to chat
|
void |
put(java.lang.String message,
int playerID)
Construct a message and put it in the list
|
int |
size()
Get the size of the chat
|
private static final long serialVersionUID
private java.util.List<ChatMessage> messages
public void put(java.lang.String message, int playerID)
message
- the messageplayerID
- the ID of the player who sent the messagepublic ChatMessage get(int i)
i
- the chat message to getpublic int size()
public int lastChatter()