#pragma once

#include "ehs/Str.h"
#include "ehs/Array.h"
#include "ehs/Serializer.h"

namespace ehs
{
	class EHC;
	class NetEnd;
	class NetOp;

	class NetSys
	{
	private:
		friend class EHC;

		UInt_64 hashId;
		Str_8 id;
		Array<NetOp*> ops;

	public:
		virtual ~NetSys();

		NetSys();

		NetSys(Str_8 id);

		NetSys(NetSys &&sys) noexcept;

		NetSys(const NetSys &sys);

		NetSys &operator=(NetSys &&sys) noexcept;

		NetSys &operator=(const NetSys &sys);

		Str_8 GetId() const;

		UInt_64 GetHashId() const;

		bool HasOperation(UInt_64 hashId) const;

		bool AddOperation(NetOp *op);

	private:
		void Execute(EHC *ehc, NetEnd *endpoint, UInt_64 hashId, Serializer<UInt_64> &payload);
	};
}