#ifndef SOCKET_H
#define SOCKET_H

#include "aitest.h"

class AICpu;
class FrameData;

class Socket:public QUdpSocket
{
	Q_OBJECT
	
	public:
		Socket(const QString &address, QObject *parent = 0);
		~Socket();
	public slots:
		void initialSend();
	private:
		bool parseFrame(const QByteArray &frame);
		void normalizePositions();
		void mergeFrames();

		AICpu *cpu;
		FrameData *frameData;

		int nShots;
		int nExplosions;
	private slots:
		void receiveFrame();
};





#endif