blob: 3daefb0ab738799563e98c8d0ef83a8b99060f1a (
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
29
30
31
32
33
34
35
36
|
package net.cshift.transit.network.packet;
import net.cshift.transit.type.*;
/** Simple packet which stores an unchanging value.
* @author Kyle Gunger
*
* @param <D> The data type (Object) that the packet transfers.
*/
public class StaticPacket<D> implements IStaticPacket<D>
{
private Object data;
private Type<D> type;
/** Constructor. Stores the given data and uses the given type.
*
* @param dat The packet's data
* @param t The packet's type
*/
public StaticPacket(Object dat, Type<D> t)
{
data = dat;
type = t;
}
@Override
public Object getData()
{
return data;
}
@Override
public Type<D> getType() {
return type;
}
}
|