blob: eeeae3fa40ec9086810cbfcb428607b15073045d (
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.transit.network.packet;
import net.transit.type.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 D 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(D dat, Type<D> t)
{
data = dat;
type = t;
}
@Override
public D getData()
{
return data;
}
@Override
public Type<D> getType() {
return type;
}
}
|