Back to project page Freebloks-Android.
The source code is released under:
GNU General Public License
If you think the Android project Freebloks-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.saschahlusiak.freebloks.lobby; // w w w .j a v a2 s.com import java.io.Serializable; import de.saschahlusiak.freebloks.Global; import de.saschahlusiak.freebloks.controller.GameMode; import android.graphics.Color; public class ChatEntry implements Serializable { private static final long serialVersionUID = 1L; int client; String text, name; int player; public ChatEntry(int client, String text, String name) { this.client = client; this.text = text; this.name = name; player = -1; } public void setPlayer(int player) { this.player = player; } int getColor(GameMode gamemode) { final int extra_colors[] = { Color.CYAN, Color.MAGENTA, Color.LTGRAY, Color.WHITE }; if (player < 0) return extra_colors[client % extra_colors.length]; else return Global.PLAYER_FOREGROUND_COLOR[Global.getPlayerColor(player, gamemode)]; } @Override public String toString() { if (client < 0) return "* " + text; return name + ": " + text; } }