package com.cardshifter.api.outgoing;

import com.cardshifter.api.ArrayUtil;
import com.cardshifter.api.messages.Message;

import java.util.Arrays;

public class AvailableTargetsMessage extends Message {

	private int entity;
	private String action;
	private int min;
	private int max;
	private int[] targets;

	public AvailableTargetsMessage() {
		this(0, "", new int[0], 0, 0);
	}

	public AvailableTargetsMessage(int entity, String action, int[] targets, int min, int max) {
		super("targets");
		this.entity = entity;
		this.action = action;
		this.min = min;
		this.max = max;
		this.targets = ArrayUtil.copyOf(targets);
	}
	
	public int getMax() {
		return max;
	}
	
	public int getMin() {
		return min;
	}
	
	public int[] getTargets() {
		return ArrayUtil.copyOf(targets);
	}

	public String getAction() {
		return action;
	}
	
	public int getEntity() {
		return entity;
	}

	@Override
	public String toString() {
		return "AvailableTargetsMessage [entity=" + entity + ", action="
				+ action + ", min=" + min + ", max=" + max + ", targets="
				+ Arrays.toString(targets) + "]";
	}
	
}

@@ -142,16 +142,277 @@
 rrays;%0A%0A
+/**%0A * Send available targets to client.%0A * %3Cp%3E%0A * Many game actions are performed on targets. %0A * This message sends available targets to the client so that the player entity can select from among them.%0A * See also: api/incoming/RequestTargetsMessage.java%0A */%0A
 public c
@@ -564,16 +564,50 @@
 argets;%0A
+%09%0A%09/** Constructor. (no params) */
 %0A%09public
@@ -667,24 +667,287 @@
 , 0, 0);%0A%09%7D%0A
+%09/**%0A%09 * Constructor.%0A%09 * @param entity  Id of this entity%0A%09 * @param action  Name of this action%0A%09 * @param targets  Set of targets available for this entity and this action%0A%09 * @param min  Minimum number of targets%0A%09 * @param max  Maximum number of targets%0A%09 */
 %0A%09public Ava
@@ -1177,24 +1177,65 @@
 rgets);%0A%09%7D%0A%09
+/** @return  Maximum number of targets */
 %0A%09public int
@@ -1260,24 +1260,65 @@
 rn max;%0A%09%7D%0A%09
+/** @return  Minimum number of targets */
 %0A%09public int
@@ -1343,24 +1343,96 @@
 rn min;%0A%09%7D%0A%09
+/** @return  Set of targets available for this entity and this action */
 %0A%09public int
@@ -1488,16 +1488,52 @@
 ts);%0A%09%7D%0A
+%09/** @return  Name of this action */
 %0A%09public
@@ -1575,16 +1575,49 @@
 on;%0A%09%7D%0A%09
+/** @return  Id of this entity */
 %0A%09public
@@ -1655,16 +1655,82 @@
 ity;%0A%09%7D%0A
+%09/** @return  The name of this action requested to be performed */
 %0A%09@Overr

Update AvailableTargetsMessage.java