summaryrefslogtreecommitdiff
path: root/src/main/java/net/transit/network/packet/MetaPacket.java
blob: 7e4931890f1d81cc51846a61db58ff331a484eea (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
package net.transit.network.packet;

import net.transit.type.Type;

/** Static packet with extra data attached.
 * @author Kyle Gunger
 *
 * @param <D> The data type (Object) that the packet transfers
 * @param <M> The type of metadata
*/
public class MetaPacket<D, M> extends StaticPacket<D>
{
	private M metaData;

    /** Constructor
     * 
     * @param dat The data to store
     * @param t The Type of the data
     * @param meta The metadata to store
     */
    public MetaPacket(D dat, Type<D> t, M meta)
    {
        super(dat, t);
        metaData = meta;
    }
    
    /** Get the metadata of the packet.
     * 
     * @return The packet's metadata
     */
    public M getMetaData()
    {
    	return metaData;
    }
}