package com.cardshifter.api.outgoing;

import com.cardshifter.api.messages.Message;

public class UsableActionMessage extends Message {

	private int id;
	private String action;
	private boolean targetRequired;
	private int targetId;

    public UsableActionMessage() {
		this(0, "", false, 0);
	}

	public UsableActionMessage(int id, String action, boolean targetRequired, int target) {
		super("useable");
		this.id = id;
		this.action = action;
		this.targetRequired = targetRequired;
		this.targetId = target;
	}
	
	public UsableActionMessage(int entityId, String name, boolean needsTarget) {
		this(entityId, name, needsTarget, 0);
	}

	public String getAction() {
		return action;
	}
	
	public int getId() {
		return id;
	}
	
	public boolean isTargetRequired() {
		return targetRequired;
	}
	
	public int getTargetId() {
		return targetId;
	}

	@Override
	public String toString() {
		return "UsableActionMessage [id=" + id + ", action=" + action
				+ ", targetRequired=" + targetRequired + ", targetId="
				+ targetId + "]";
	}

}

@@ -77,16 +77,52 @@
 essage;%0A
+/** Communicates a usable action. */
 %0Apublic 
@@ -267,13 +267,48 @@
 Id;%0A
+%09%0A%09/** Constructor. (no params) */
 %0A
- 
    
+ %09
 publ
@@ -366,228 +366,718 @@
 %0A%09%7D%0A
-%0A%09public UsableActionMessage(int id, String action, boolean targetRequired, int target) %7B%0A%09%09super(%22useable%22);%0A%09%09this.id = id;%0A%09%09this.action = action;%0A%09%09this.targetRequired = targetRequired;%0A%09%09this.targetId = target;%0A%09%7D%0A%09
+%09/**%0A%09 * Constructor.%0A%09 * %3Cp%3E%0A%09 * Used for actions where a target is required.%0A%09 * %0A%09 * @param id  This entity%0A%09 * @param action  This action%0A%09 * @param targetRequired  Whether or not a target is required for this action%0A%09 * @param target  The target of this action%0A%09 */%0A%09public UsableActionMessage(int id, String action, boolean targetRequired, int target) %7B%0A%09%09super(%22useable%22);%0A%09%09this.id = id;%0A%09%09this.action = action;%0A%09%09this.targetRequired = targetRequired;%0A%09%09this.targetId = target;%0A%09%7D%0A%09/** %0A%09 * Constructor.%0A%09 * %3Cp%3E%0A%09 * Used for actions where a target is not required.%0A%09 * %0A%09 * @param entityId  This entity%0A%09 * @param name  This action%0A%09 * @param needsTarget  Whether of not this action needs a target%0A%09 */
 %0A%09pu
@@ -1194,16 +1194,44 @@
  0);%0A%09%7D%0A
+%09/** @return  This action */
 %0A%09public
@@ -1269,24 +1269,51 @@
 action;%0A%09%7D%0A%09
+/** @return  This entity */
 %0A%09public int
@@ -1336,24 +1336,75 @@
 urn id;%0A%09%7D%0A%09
+/** @return  Whether or not a target is required */
 %0A%09public boo
@@ -1458,16 +1458,57 @@
 ed;%0A%09%7D%0A%09
+/** @return  The target of this action */
 %0A%09public
@@ -1550,16 +1550,69 @@
 tId;%0A%09%7D%0A
+%09/** @return  This message as converted to String  */
 %0A%09@Overr
@@ -1674,16 +1674,24 @@
 essage %5B
+%22%0A%09%09%09%09+ 
 id=%22 + i
@@ -1692,16 +1692,21 @@
 =%22 + id 
+%0A%09%09%09%09
 + %22, act
@@ -1763,16 +1763,21 @@
 equired 
+%0A%09%09%09%09
 + %22, tar
@@ -1783,21 +1783,17 @@
 rgetId=%22
-%0A%09%09%09%09
+ 
 + target
@@ -1795,16 +1795,21 @@
 argetId 
+%0A%09%09%09%09
 + %22%5D%22;%0A%09

Update UsableActionMessage.java