namespace Network.PacketHandling {
    public abstract class Serializable {

        public bool Reliable;
        public int ID;

        public void Serialize(PacketBuffer packetBuffer) {
            packetBuffer.Write(Reliable);
            packetBuffer.Write(ID);
            WriteContents(packetBuffer);
        }

        public void Deserialize(PacketBuffer packetBuffer) {
            Reliable = packetBuffer.ReadBool();
            ID = packetBuffer.ReadInt();
            ReadContents(packetBuffer);
        }

        public abstract void WriteContents(PacketBuffer packetBuffer);
        public abstract void ReadContents(PacketBuffer packetBuffer);

    }
}