summaryrefslogtreecommitdiff
path: root/src/common/PeerMessage.java
blob: 4e292b970d7aee1080a8f6703c4ba3f6852e5219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package common;
import java.io.*;
import java.util.*;


public class PeerMessage implements Serializable {
	private static final long serialVersionUID = 3667108226485766929L;
	public static final String DEFAULT_ID = "TesseractProject"; 
	
	public enum Type {
		JOIN, JOIN_RESULT, ADD_PEERS, REMOVE_PEERS, PAYLOAD, EXTRA;
	}

	public Type type;
	public PeerInformation sender;
	public PeerCoordinates location;
	public ArrayList<PeerInformation> peers;
	public CollidableObject payload;
	public Object extra;
	public String id;

	public PeerMessage(Type type, PeerInformation sender) {
		this.type = type;
		this.sender = sender;
		peers = new ArrayList<PeerInformation>();
		this.id = DEFAULT_ID;
	}
}