MCPcopy Create free account
hub / github.com/catabriga/graphwar / addToChat

Method addToChat

src/Graphwar/GlobalClient.java:245–266  ·  view source on GitHub ↗
(int playerId, String chatMessage)

Source from the content-addressed store, hash-verified

243 }
244
245 private void addToChat(int playerId, String chatMessage)
246 {
247 String playerName = "Anon";
248
249 synchronized(players)
250 {
251 ListIterator<LobbyPlayer> itr = players.listIterator();
252
253 while(itr.hasNext())
254 {
255 LobbyPlayer player = itr.next();
256
257 if(player.getID() == playerId)
258 {
259 playerName = player.getName();
260 break;
261 }
262 }
263 }
264
265 ((GlobalScreen)graphwar.getUI().getScreen(Constants.GLOBAL_ROOM_SCREEN)).addChat(playerName, chatMessage);
266 }
267
268 private void handleMessage(String message)
269 {

Callers 1

handleMessageMethod · 0.95

Calls 5

getIDMethod · 0.95
getNameMethod · 0.95
getScreenMethod · 0.80
getUIMethod · 0.80
addChatMethod · 0.45

Tested by

no test coverage detected