PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/packets/ChatCmd.java

http://inequity.googlecode.com/
Java | 39 lines | 25 code | 5 blank | 9 comment | 0 complexity | f858579fdce80fccd73192d997d09bcd MD5 | raw file
 1package packets;
 2
 3import elements.Consts.Priorities;
 4import network.ClientController;
 5
 6/**
 7 *
 8 * @author Joel Garboden
 9 */
10public class ChatCmd extends Command
11{
12  private String message;
13  private String playerName;
14
15  /**
16   *
17   * @param playerName
18   * @param message
19   */
20  public ChatCmd(String playerName, String message)
21  {
22    this.playerName = playerName;
23    this.priority = Priorities.CHAT_MSG;
24    this.message = message;
25  }
26
27  @Override
28  public boolean execCommand(ClientController client)
29  {
30    client.postChat(playerName, message);
31    return true;
32  }
33
34  @Override
35  public String toString()
36  {
37    return playerName + ": " + message;
38  }
39}