package com.cardshifter.api.outgoing;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.cardshifter.api.messages.Message;

public class PlayerMessage extends Message {
//	SERVER: command: player, name: 'Bubu', properties: { hp: 23 }

	private String name;
	private Map<String, Integer> properties;
	private int index;
	private int id;

	public PlayerMessage() {
		this(0, 0, "", new HashMap<String, Integer>());
	}

	public PlayerMessage(int id, int index, String name, Map<String, Integer> properties) {
		super("player");
		this.index = index;
		this.id = id;
		this.name = name;
		this.properties = properties;
	}

	public String getName() {
		return name;
	}
	
	public Map<String, Integer> getProperties() {
		return Collections.unmodifiableMap(properties);
	}
	
	@Override
	public String toString() {
		return "Player Info: " + name + " - " + properties;
	}
	
	public int getIndex() {
		return index;
	}
	
	public int getId() {
		return id;
	}
}

@@ -161,117 +161,109 @@
 e;%0A%0A
-public class PlayerMessage extends Message %7B%0A//%09SERVER: command: player, name: 'Bubu', properties: %7B hp: 23 %7D
+/** Message which contains properties about a player. */%0Apublic class PlayerMessage extends Message %7B
 %0A%0A%09p
@@ -362,16 +362,49 @@
 nt id;%0A%0A
+%09/** Constructor. (no params) */%0A
 %09public 
@@ -470,24 +470,253 @@
 ger%3E());%0A%09%7D%0A
+%09/**%0A%09 * Constructor.%0A%09 * @param id  The Id of this player%0A%09 * @param index  The index of this player%0A%09 * @param name  The name of this player%0A%09 * @param properties  The properties applicable to this player as Name/Value map%0A%09 */
 %0A%09public Pla
@@ -905,16 +905,56 @@
 ies;%0A%09%7D%0A
+%09/** @return  The name of this player */
 %0A%09public
@@ -988,24 +988,98 @@
 n name;%0A%09%7D%0A%09
+/** @return  The properties applicable to this player as Name/Value map */
 %0A%09public Map
@@ -1168,16 +1168,327 @@
 s);%0A%09%7D%0A%09
+/** @return  The index of this player */%0A%09public int getIndex() %7B%0A%09%09return index;%0A%09%7D%0A%09/**@return  The Id of this player  */%0A%09public int getId() %7B%0A%09%09return id;%0A%09%7D%0A%09/** %0A%09 * @return  This message as converted to String %0A%09 * @example  %3Ccode%3ESERVER: command: player, name: 'Bubu', properties: %7B hp: 23 %7D%3C/code%3E%0A%09 */
 %0A%09@Overr
@@ -1580,92 +1580,6 @@
 %0A%09%7D%0A
-%09%0A%09public int getIndex() %7B%0A%09%09return index;%0A%09%7D%0A%09%0A%09public int getId() %7B%0A%09%09return id;%0A%09%7D%0A
 %7D%0A

Update PlayerMessage.java