package common.packet;

import java.io.IOException;

import common.network.Packet;
import common.network.PacketBuffer;

public abstract class APacketVarInt<T> implements Packet<T> {
	private int value;

	public APacketVarInt() {
	}

	public APacketVarInt(int value) {
		this.value = value;
	}

	public final void readPacketData(PacketBuffer buf) throws IOException {
		this.value = buf.readVarInt();
	}

	public final void writePacketData(PacketBuffer buf) throws IOException {
		buf.writeVarInt(this.value);
	}

	public final int getValue() {
		return this.value;
	}
}
