// Copyright (c) coherence ApS.
// For all coherence generated code, the coherence SDK license terms apply. See the license file in the coherence Package root folder for more information.

// <auto-generated>
// Generated file. DO NOT EDIT!
// </auto-generated>
namespace Coherence.Generated
{
	using Coherence.ProtocolDef;
	using Coherence.Serializer;
	using Coherence.Brook;
	using UnityEngine;
	using Coherence.Entity;

	public struct QuerySynced : IEntityCommand
	{
		public bool liveQuerySynced;
		public bool globalQuerySynced;

		public MessageTarget Routing => MessageTarget.All;
		public uint GetComponentType() => Definition.InternalQuerySynced;

		public QuerySynced
		(
			bool dataliveQuerySynced,
			bool dataglobalQuerySynced
		)
		{
			liveQuerySynced = dataliveQuerySynced;
			globalQuerySynced = dataglobalQuerySynced;
		}

		public static void Serialize(QuerySynced commandData, IOutProtocolBitStream bitStream)
		{
			bitStream.WriteBool(commandData.liveQuerySynced);
			bitStream.WriteBool(commandData.globalQuerySynced);
		}

		public static QuerySynced Deserialize(IInProtocolBitStream bitStream)
		{
			var dataliveQuerySynced = bitStream.ReadBool();
			var dataglobalQuerySynced = bitStream.ReadBool();

			return new QuerySynced
			(
				dataliveQuerySynced,
				dataglobalQuerySynced
			){};
		}
	}
}
