package com.cardshifter.api.outgoing;

import java.util.Arrays;

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

public class ZoneMessage extends Message {
//	SERVER: command: zone, name: 'Deck', owner: 0, id: 7, (playerIndex), size: 42, hidden: true

	private int id;
	private String name;
	private int owner;
	private int size;
	private boolean known;
	private int[] entities;

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

	public ZoneMessage(int id, String name, int owner, int size, boolean known, int[] entities) {
		super("zone");
		this.id = id;
		this.name = name;
		this.owner = owner;
		this.size = size;
		this.known = known;
		this.entities = ArrayUtil.copyOf(entities);
	}
	
	public int getId() {
		return id;
	}
	
	public String getName() {
		return name;
	}
	
	public int getOwner() {
		return owner;
	}
	
	public int getSize() {
		return size;
	}

	public boolean isKnown() {
		return known;
	}
	
	public int[] getEntities() {
		return ArrayUtil.copyOf(entities);
	}

	@Override
	public String toString() {
		return "ZoneMessage [id=" + id + ", name=" + name + ", owner=" + owner + ", size=" + size + ", known=" + known + "]";
	}
	
}

@@ -142,16 +142,64 @@
 ssage;%0A%0A
+/** Message containing properties of a zone. */%0A
 public c
@@ -457,16 +457,49 @@
 ities;%0A%0A
+%09/** Constructor. (no params) */%0A
 %09public 
@@ -554,24 +554,309 @@
 nt%5B%5D%7B%7D);%0A%09%7D%0A
+%09/**%0A%09 * Constructor.%0A%09 * @param id  The Id of this zone%0A%09 * @param name  The name of this zone%0A%09 * @param owner  The owner of this zone%0A%09 * @param size  The size of this zone%0A%09 * @param known  Whether this zone is known or hidden%0A%09 * @param entities  Set of entities in this zone%0A%09 */
 %0A%09public Zon
@@ -1102,24 +1102,59 @@
 ities);%0A%09%7D%0A%09
+/** @return  The Id of this zone */
 %0A%09public int
@@ -1177,24 +1177,61 @@
 urn id;%0A%09%7D%0A%09
+/** @return  The name of this zone */
 %0A%09public Str
@@ -1261,24 +1261,62 @@
 n name;%0A%09%7D%0A%09
+/** @return  The owner of this zone */
 %0A%09public int
@@ -1345,24 +1345,61 @@
  owner;%0A%09%7D%0A%09
+/** @return  The size of this zone */
 %0A%09public int
@@ -1429,16 +1429,69 @@
 ize;%0A%09%7D%0A
+%09/** @return  Whether this zone is known or hidden */
 %0A%09public
@@ -1531,16 +1531,60 @@
 wn;%0A%09%7D%0A%09
+/** @return  Set of entities in this zone */
 %0A%09public
@@ -1646,16 +1646,69 @@
 es);%0A%09%7D%0A
+%09/** @return  This message as converted to String  */
 %0A%09@Overr
@@ -1762,16 +1762,24 @@
 essage %5B
+%22%0A%09%09%09+ %22
 id=%22 + i
@@ -1780,16 +1780,20 @@
 =%22 + id 
+%0A%09%09%09
 + %22, nam
@@ -1803,16 +1803,20 @@
  + name 
+%0A%09%09%09
 + %22, own
@@ -1828,16 +1828,20 @@
 + owner 
+%0A%09%09%09
 + %22, siz
@@ -1851,16 +1851,20 @@
  + size 
+%0A%09%09%09
 + %22, kno
@@ -1876,16 +1876,19 @@
 + known 
+%0A%09%09
 + %22%5D%22;%0A%09

Update ZoneMessage.java