// 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.Brook;
	using Coherence.Connection;
	using Coherence.Entity;
	using Coherence.Serializer;
	using Coherence.Log;
	using System.Collections.Generic;

	public class Definition : IDefinition
	{
		public const string schemaId = "8aa5ffc3764971d8ca0d1d7b6deedf551cc75087";
		public const uint InternalWorldPosition = 0;
		public const uint InternalWorldOrientation = 1;
		public const uint InternalLocalUser = 2;
		public const uint InternalWorldPositionQuery = 3;
		public const uint InternalArchetypeComponent = 4;
		public const uint InternalPersistence = 5;
		public const uint InternalConnectedEntity = 6;
		public const uint InternalUniqueID = 7;
		public const uint InternalConnection = 8;
		public const uint InternalGlobal = 9;
		public const uint InternalGlobalQuery = 10;
		public const uint InternalTag = 11;
		public const uint InternalTagQuery = 12;
		public const uint InternalPreserveChildren = 13;
		public const uint InternalGenericPrefabReference = 14;
		public const uint InternalGenericPrefabId = 15;
		public const uint InternalGenericScale = 16;
		public const uint InternalGenericFieldInt0 = 17;
		public const uint InternalGenericFieldInt1 = 18;
		public const uint InternalGenericFieldInt2 = 19;
		public const uint InternalGenericFieldInt3 = 20;
		public const uint InternalGenericFieldInt4 = 21;
		public const uint InternalGenericFieldInt5 = 22;
		public const uint InternalGenericFieldInt6 = 23;
		public const uint InternalGenericFieldInt7 = 24;
		public const uint InternalGenericFieldInt8 = 25;
		public const uint InternalGenericFieldInt9 = 26;
		public const uint InternalGenericFieldUInt0 = 27;
		public const uint InternalGenericFieldUInt1 = 28;
		public const uint InternalGenericFieldUInt2 = 29;
		public const uint InternalGenericFieldUInt3 = 30;
		public const uint InternalGenericFieldUInt4 = 31;
		public const uint InternalGenericFieldUInt5 = 32;
		public const uint InternalGenericFieldUInt6 = 33;
		public const uint InternalGenericFieldUInt7 = 34;
		public const uint InternalGenericFieldUInt8 = 35;
		public const uint InternalGenericFieldUInt9 = 36;
		public const uint InternalGenericFieldBool0 = 37;
		public const uint InternalGenericFieldBool1 = 38;
		public const uint InternalGenericFieldBool2 = 39;
		public const uint InternalGenericFieldBool3 = 40;
		public const uint InternalGenericFieldBool4 = 41;
		public const uint InternalGenericFieldBool5 = 42;
		public const uint InternalGenericFieldBool6 = 43;
		public const uint InternalGenericFieldBool7 = 44;
		public const uint InternalGenericFieldBool8 = 45;
		public const uint InternalGenericFieldBool9 = 46;
		public const uint InternalGenericFieldFloat0 = 47;
		public const uint InternalGenericFieldFloat1 = 48;
		public const uint InternalGenericFieldFloat2 = 49;
		public const uint InternalGenericFieldFloat3 = 50;
		public const uint InternalGenericFieldFloat4 = 51;
		public const uint InternalGenericFieldFloat5 = 52;
		public const uint InternalGenericFieldFloat6 = 53;
		public const uint InternalGenericFieldFloat7 = 54;
		public const uint InternalGenericFieldFloat8 = 55;
		public const uint InternalGenericFieldFloat9 = 56;
		public const uint InternalGenericFieldDouble0 = 57;
		public const uint InternalGenericFieldDouble1 = 58;
		public const uint InternalGenericFieldDouble2 = 59;
		public const uint InternalGenericFieldDouble3 = 60;
		public const uint InternalGenericFieldDouble4 = 61;
		public const uint InternalGenericFieldDouble5 = 62;
		public const uint InternalGenericFieldDouble6 = 63;
		public const uint InternalGenericFieldDouble7 = 64;
		public const uint InternalGenericFieldDouble8 = 65;
		public const uint InternalGenericFieldDouble9 = 66;
		public const uint InternalGenericFieldVector0 = 67;
		public const uint InternalGenericFieldVector1 = 68;
		public const uint InternalGenericFieldVector2 = 69;
		public const uint InternalGenericFieldVector3 = 70;
		public const uint InternalGenericField2dVector0 = 71;
		public const uint InternalGenericField2dVector1 = 72;
		public const uint InternalGenericField2dVector2 = 73;
		public const uint InternalGenericField2dVector3 = 74;
		public const uint InternalGenericFieldString0 = 75;
		public const uint InternalGenericFieldString1 = 76;
		public const uint InternalGenericFieldString2 = 77;
		public const uint InternalGenericFieldString3 = 78;
		public const uint InternalGenericFieldString4 = 79;
		public const uint InternalGenericFieldQuaternion0 = 80;
		public const uint InternalGenericFieldEntity0 = 81;
		public const uint InternalGenericFieldEntity1 = 82;
		public const uint InternalGenericFieldEntity2 = 83;
		public const uint InternalGenericFieldEntity3 = 84;
		public const uint InternalGenericFieldEntity4 = 85;
		public const uint InternalGenericFieldEntity5 = 86;
		public const uint InternalGenericFieldEntity6 = 87;
		public const uint InternalGenericFieldEntity7 = 88;
		public const uint InternalGenericFieldEntity8 = 89;
		public const uint InternalGenericFieldEntity9 = 90;
		public const uint InternalGenericFieldBytes0 = 91;
		public const uint InternalGenericFieldLong0 = 92;
		public const uint InternalGenericFieldLong1 = 93;
		public const uint InternalGenericFieldLong2 = 94;
		public const uint InternalGenericFieldLong3 = 95;
		public const uint InternalGenericFieldULong0 = 96;
		public const uint InternalGenericFieldULong1 = 97;
		public const uint InternalGenericFieldULong2 = 98;
		public const uint InternalGenericFieldULong3 = 99;
		public const uint InternalGenericFieldColor0 = 100;
		public const uint InternalGenericFieldColor1 = 101;
		public const uint InternalBackgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648 = 102;
		public const uint InternalMiniGameManager_HotPotatoManager_8222345003895092174 = 103;
		public const uint InternalSprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270 = 104;
		public const uint InternalSquare_UnityEngine__char_46_SpriteRenderer_4692109573835368250 = 105;
		public const uint InternalArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_WorldPosition_LOD0 = 106;
		public const uint InternalArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648_LOD0 = 107;
		public const uint InternalArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_WorldPosition_LOD0 = 108;
		public const uint InternalArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_MiniGameManager_HotPotatoManager_8222345003895092174_LOD0 = 109;
		public const uint InternalArchetypePlayer0_1b8b60cb7c844004ba711d3409682a23_WorldPosition_LOD0 = 110;
		public const uint InternalArchetypePlayer1_358f1ade9e8606544972b75cb628cfd9_WorldPosition_LOD0 = 111;
		public const uint InternalArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_WorldPosition_LOD0 = 112;
		public const uint InternalArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270_LOD0 = 113;
		public const uint InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldPosition_LOD0 = 114;
		public const uint InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldOrientation_LOD0 = 115;
		public const uint InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_GenericScale_LOD0 = 116;
		public const uint InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250_LOD0 = 117;
		public const uint InternalAuthorityRequest = 0;
		public const uint InternalAuthorityTransfer = 1;
		public const uint InternalQuerySynced = 2;
		public const uint InternalAdoptOrphan = 3;
		public const uint InternalPersistenceReady = 4;
		public const uint InternalGenericCommand = 5;

		private static readonly Dictionary<uint, string> componentNamesForTypeIds = new Dictionary<uint, string>() {
			{ 0, "WorldPosition" },
			{ 1, "WorldOrientation" },
			{ 2, "LocalUser" },
			{ 3, "WorldPositionQuery" },
			{ 4, "ArchetypeComponent" },
			{ 5, "Persistence" },
			{ 6, "ConnectedEntity" },
			{ 7, "UniqueID" },
			{ 8, "Connection" },
			{ 9, "Global" },
			{ 10, "GlobalQuery" },
			{ 11, "Tag" },
			{ 12, "TagQuery" },
			{ 13, "PreserveChildren" },
			{ 14, "GenericPrefabReference" },
			{ 15, "GenericPrefabId" },
			{ 16, "GenericScale" },
			{ 17, "GenericFieldInt0" },
			{ 18, "GenericFieldInt1" },
			{ 19, "GenericFieldInt2" },
			{ 20, "GenericFieldInt3" },
			{ 21, "GenericFieldInt4" },
			{ 22, "GenericFieldInt5" },
			{ 23, "GenericFieldInt6" },
			{ 24, "GenericFieldInt7" },
			{ 25, "GenericFieldInt8" },
			{ 26, "GenericFieldInt9" },
			{ 27, "GenericFieldUInt0" },
			{ 28, "GenericFieldUInt1" },
			{ 29, "GenericFieldUInt2" },
			{ 30, "GenericFieldUInt3" },
			{ 31, "GenericFieldUInt4" },
			{ 32, "GenericFieldUInt5" },
			{ 33, "GenericFieldUInt6" },
			{ 34, "GenericFieldUInt7" },
			{ 35, "GenericFieldUInt8" },
			{ 36, "GenericFieldUInt9" },
			{ 37, "GenericFieldBool0" },
			{ 38, "GenericFieldBool1" },
			{ 39, "GenericFieldBool2" },
			{ 40, "GenericFieldBool3" },
			{ 41, "GenericFieldBool4" },
			{ 42, "GenericFieldBool5" },
			{ 43, "GenericFieldBool6" },
			{ 44, "GenericFieldBool7" },
			{ 45, "GenericFieldBool8" },
			{ 46, "GenericFieldBool9" },
			{ 47, "GenericFieldFloat0" },
			{ 48, "GenericFieldFloat1" },
			{ 49, "GenericFieldFloat2" },
			{ 50, "GenericFieldFloat3" },
			{ 51, "GenericFieldFloat4" },
			{ 52, "GenericFieldFloat5" },
			{ 53, "GenericFieldFloat6" },
			{ 54, "GenericFieldFloat7" },
			{ 55, "GenericFieldFloat8" },
			{ 56, "GenericFieldFloat9" },
			{ 57, "GenericFieldDouble0" },
			{ 58, "GenericFieldDouble1" },
			{ 59, "GenericFieldDouble2" },
			{ 60, "GenericFieldDouble3" },
			{ 61, "GenericFieldDouble4" },
			{ 62, "GenericFieldDouble5" },
			{ 63, "GenericFieldDouble6" },
			{ 64, "GenericFieldDouble7" },
			{ 65, "GenericFieldDouble8" },
			{ 66, "GenericFieldDouble9" },
			{ 67, "GenericFieldVector0" },
			{ 68, "GenericFieldVector1" },
			{ 69, "GenericFieldVector2" },
			{ 70, "GenericFieldVector3" },
			{ 71, "GenericField2dVector0" },
			{ 72, "GenericField2dVector1" },
			{ 73, "GenericField2dVector2" },
			{ 74, "GenericField2dVector3" },
			{ 75, "GenericFieldString0" },
			{ 76, "GenericFieldString1" },
			{ 77, "GenericFieldString2" },
			{ 78, "GenericFieldString3" },
			{ 79, "GenericFieldString4" },
			{ 80, "GenericFieldQuaternion0" },
			{ 81, "GenericFieldEntity0" },
			{ 82, "GenericFieldEntity1" },
			{ 83, "GenericFieldEntity2" },
			{ 84, "GenericFieldEntity3" },
			{ 85, "GenericFieldEntity4" },
			{ 86, "GenericFieldEntity5" },
			{ 87, "GenericFieldEntity6" },
			{ 88, "GenericFieldEntity7" },
			{ 89, "GenericFieldEntity8" },
			{ 90, "GenericFieldEntity9" },
			{ 91, "GenericFieldBytes0" },
			{ 92, "GenericFieldLong0" },
			{ 93, "GenericFieldLong1" },
			{ 94, "GenericFieldLong2" },
			{ 95, "GenericFieldLong3" },
			{ 96, "GenericFieldULong0" },
			{ 97, "GenericFieldULong1" },
			{ 98, "GenericFieldULong2" },
			{ 99, "GenericFieldULong3" },
			{ 100, "GenericFieldColor0" },
			{ 101, "GenericFieldColor1" },
			{ 102, "Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648" },
			{ 103, "MiniGameManager_HotPotatoManager_8222345003895092174" },
			{ 104, "Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270" },
			{ 105, "Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250" },
			{ 106, "ArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_WorldPosition_LOD0" },
			{ 107, "ArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648_LOD0" },
			{ 108, "ArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_WorldPosition_LOD0" },
			{ 109, "ArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_MiniGameManager_HotPotatoManager_8222345003895092174_LOD0" },
			{ 110, "ArchetypePlayer0_1b8b60cb7c844004ba711d3409682a23_WorldPosition_LOD0" },
			{ 111, "ArchetypePlayer1_358f1ade9e8606544972b75cb628cfd9_WorldPosition_LOD0" },
			{ 112, "ArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_WorldPosition_LOD0" },
			{ 113, "ArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270_LOD0" },
			{ 114, "ArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldPosition_LOD0" },
			{ 115, "ArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldOrientation_LOD0" },
			{ 116, "ArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_GenericScale_LOD0" },
			{ 117, "ArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250_LOD0" },
		};

		public static string ComponentNameForTypeId(uint typeId)
		{
			if(componentNamesForTypeIds.TryGetValue(typeId, out string componentName))
			{
				return componentName;
			}
			else
			{
				return "";
			}
		}

		public (ICoherenceComponentData, uint, uint?) ReadComponentUpdate(uint componentType, 
			IInBitStream bitStream, Logger logger)
		{
			var inProtocolStream = new InProtocolBitStream(bitStream);

			switch (componentType)
			{
				case InternalWorldPosition:
					return WorldPosition.Deserialize(inProtocolStream);
				case InternalWorldOrientation:
					return WorldOrientation.Deserialize(inProtocolStream);
				case InternalLocalUser:
					return LocalUser.Deserialize(inProtocolStream);
				case InternalWorldPositionQuery:
					return WorldPositionQuery.Deserialize(inProtocolStream);
				case InternalArchetypeComponent:
					return ArchetypeComponent.Deserialize(inProtocolStream);
				case InternalPersistence:
					return Persistence.Deserialize(inProtocolStream);
				case InternalConnectedEntity:
					return ConnectedEntity.Deserialize(inProtocolStream);
				case InternalUniqueID:
					return UniqueID.Deserialize(inProtocolStream);
				case InternalConnection:
					return Connection.Deserialize(inProtocolStream);
				case InternalGlobal:
					return Global.Deserialize(inProtocolStream);
				case InternalGlobalQuery:
					return GlobalQuery.Deserialize(inProtocolStream);
				case InternalTag:
					return Tag.Deserialize(inProtocolStream);
				case InternalTagQuery:
					return TagQuery.Deserialize(inProtocolStream);
				case InternalPreserveChildren:
					return PreserveChildren.Deserialize(inProtocolStream);
				case InternalGenericPrefabReference:
					return GenericPrefabReference.Deserialize(inProtocolStream);
				case InternalGenericPrefabId:
					return GenericPrefabId.Deserialize(inProtocolStream);
				case InternalGenericScale:
					return GenericScale.Deserialize(inProtocolStream);
				case InternalGenericFieldInt0:
					return GenericFieldInt0.Deserialize(inProtocolStream);
				case InternalGenericFieldInt1:
					return GenericFieldInt1.Deserialize(inProtocolStream);
				case InternalGenericFieldInt2:
					return GenericFieldInt2.Deserialize(inProtocolStream);
				case InternalGenericFieldInt3:
					return GenericFieldInt3.Deserialize(inProtocolStream);
				case InternalGenericFieldInt4:
					return GenericFieldInt4.Deserialize(inProtocolStream);
				case InternalGenericFieldInt5:
					return GenericFieldInt5.Deserialize(inProtocolStream);
				case InternalGenericFieldInt6:
					return GenericFieldInt6.Deserialize(inProtocolStream);
				case InternalGenericFieldInt7:
					return GenericFieldInt7.Deserialize(inProtocolStream);
				case InternalGenericFieldInt8:
					return GenericFieldInt8.Deserialize(inProtocolStream);
				case InternalGenericFieldInt9:
					return GenericFieldInt9.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt0:
					return GenericFieldUInt0.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt1:
					return GenericFieldUInt1.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt2:
					return GenericFieldUInt2.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt3:
					return GenericFieldUInt3.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt4:
					return GenericFieldUInt4.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt5:
					return GenericFieldUInt5.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt6:
					return GenericFieldUInt6.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt7:
					return GenericFieldUInt7.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt8:
					return GenericFieldUInt8.Deserialize(inProtocolStream);
				case InternalGenericFieldUInt9:
					return GenericFieldUInt9.Deserialize(inProtocolStream);
				case InternalGenericFieldBool0:
					return GenericFieldBool0.Deserialize(inProtocolStream);
				case InternalGenericFieldBool1:
					return GenericFieldBool1.Deserialize(inProtocolStream);
				case InternalGenericFieldBool2:
					return GenericFieldBool2.Deserialize(inProtocolStream);
				case InternalGenericFieldBool3:
					return GenericFieldBool3.Deserialize(inProtocolStream);
				case InternalGenericFieldBool4:
					return GenericFieldBool4.Deserialize(inProtocolStream);
				case InternalGenericFieldBool5:
					return GenericFieldBool5.Deserialize(inProtocolStream);
				case InternalGenericFieldBool6:
					return GenericFieldBool6.Deserialize(inProtocolStream);
				case InternalGenericFieldBool7:
					return GenericFieldBool7.Deserialize(inProtocolStream);
				case InternalGenericFieldBool8:
					return GenericFieldBool8.Deserialize(inProtocolStream);
				case InternalGenericFieldBool9:
					return GenericFieldBool9.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat0:
					return GenericFieldFloat0.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat1:
					return GenericFieldFloat1.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat2:
					return GenericFieldFloat2.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat3:
					return GenericFieldFloat3.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat4:
					return GenericFieldFloat4.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat5:
					return GenericFieldFloat5.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat6:
					return GenericFieldFloat6.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat7:
					return GenericFieldFloat7.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat8:
					return GenericFieldFloat8.Deserialize(inProtocolStream);
				case InternalGenericFieldFloat9:
					return GenericFieldFloat9.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble0:
					return GenericFieldDouble0.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble1:
					return GenericFieldDouble1.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble2:
					return GenericFieldDouble2.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble3:
					return GenericFieldDouble3.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble4:
					return GenericFieldDouble4.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble5:
					return GenericFieldDouble5.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble6:
					return GenericFieldDouble6.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble7:
					return GenericFieldDouble7.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble8:
					return GenericFieldDouble8.Deserialize(inProtocolStream);
				case InternalGenericFieldDouble9:
					return GenericFieldDouble9.Deserialize(inProtocolStream);
				case InternalGenericFieldVector0:
					return GenericFieldVector0.Deserialize(inProtocolStream);
				case InternalGenericFieldVector1:
					return GenericFieldVector1.Deserialize(inProtocolStream);
				case InternalGenericFieldVector2:
					return GenericFieldVector2.Deserialize(inProtocolStream);
				case InternalGenericFieldVector3:
					return GenericFieldVector3.Deserialize(inProtocolStream);
				case InternalGenericField2dVector0:
					return GenericField2dVector0.Deserialize(inProtocolStream);
				case InternalGenericField2dVector1:
					return GenericField2dVector1.Deserialize(inProtocolStream);
				case InternalGenericField2dVector2:
					return GenericField2dVector2.Deserialize(inProtocolStream);
				case InternalGenericField2dVector3:
					return GenericField2dVector3.Deserialize(inProtocolStream);
				case InternalGenericFieldString0:
					return GenericFieldString0.Deserialize(inProtocolStream);
				case InternalGenericFieldString1:
					return GenericFieldString1.Deserialize(inProtocolStream);
				case InternalGenericFieldString2:
					return GenericFieldString2.Deserialize(inProtocolStream);
				case InternalGenericFieldString3:
					return GenericFieldString3.Deserialize(inProtocolStream);
				case InternalGenericFieldString4:
					return GenericFieldString4.Deserialize(inProtocolStream);
				case InternalGenericFieldQuaternion0:
					return GenericFieldQuaternion0.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity0:
					return GenericFieldEntity0.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity1:
					return GenericFieldEntity1.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity2:
					return GenericFieldEntity2.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity3:
					return GenericFieldEntity3.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity4:
					return GenericFieldEntity4.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity5:
					return GenericFieldEntity5.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity6:
					return GenericFieldEntity6.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity7:
					return GenericFieldEntity7.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity8:
					return GenericFieldEntity8.Deserialize(inProtocolStream);
				case InternalGenericFieldEntity9:
					return GenericFieldEntity9.Deserialize(inProtocolStream);
				case InternalGenericFieldBytes0:
					return GenericFieldBytes0.Deserialize(inProtocolStream);
				case InternalGenericFieldLong0:
					return GenericFieldLong0.Deserialize(inProtocolStream);
				case InternalGenericFieldLong1:
					return GenericFieldLong1.Deserialize(inProtocolStream);
				case InternalGenericFieldLong2:
					return GenericFieldLong2.Deserialize(inProtocolStream);
				case InternalGenericFieldLong3:
					return GenericFieldLong3.Deserialize(inProtocolStream);
				case InternalGenericFieldULong0:
					return GenericFieldULong0.Deserialize(inProtocolStream);
				case InternalGenericFieldULong1:
					return GenericFieldULong1.Deserialize(inProtocolStream);
				case InternalGenericFieldULong2:
					return GenericFieldULong2.Deserialize(inProtocolStream);
				case InternalGenericFieldULong3:
					return GenericFieldULong3.Deserialize(inProtocolStream);
				case InternalGenericFieldColor0:
					return GenericFieldColor0.Deserialize(inProtocolStream);
				case InternalGenericFieldColor1:
					return GenericFieldColor1.Deserialize(inProtocolStream);
				case InternalBackgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648:
					return Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648.Deserialize(inProtocolStream);
				case InternalMiniGameManager_HotPotatoManager_8222345003895092174:
					return MiniGameManager_HotPotatoManager_8222345003895092174.Deserialize(inProtocolStream);
				case InternalSprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270:
					return Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270.Deserialize(inProtocolStream);
				case InternalSquare_UnityEngine__char_46_SpriteRenderer_4692109573835368250:
					return Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250.Deserialize(inProtocolStream);
				case InternalArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_WorldPosition_LOD0:
					return WorldPosition.DeserializeArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_WorldPosition_LOD0(inProtocolStream);
				case InternalArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648_LOD0:
					return Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648.DeserializeArchetypeBackgroud_daf2ee43443998c43b7845ac6f687f8b_Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648_LOD0(inProtocolStream);
				case InternalArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_WorldPosition_LOD0:
					return WorldPosition.DeserializeArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_WorldPosition_LOD0(inProtocolStream);
				case InternalArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_MiniGameManager_HotPotatoManager_8222345003895092174_LOD0:
					return MiniGameManager_HotPotatoManager_8222345003895092174.DeserializeArchetypeMiniGameManager_759334206ec3a2d46b848ec8d2431208_MiniGameManager_HotPotatoManager_8222345003895092174_LOD0(inProtocolStream);
				case InternalArchetypePlayer0_1b8b60cb7c844004ba711d3409682a23_WorldPosition_LOD0:
					return WorldPosition.DeserializeArchetypePlayer0_1b8b60cb7c844004ba711d3409682a23_WorldPosition_LOD0(inProtocolStream);
				case InternalArchetypePlayer1_358f1ade9e8606544972b75cb628cfd9_WorldPosition_LOD0:
					return WorldPosition.DeserializeArchetypePlayer1_358f1ade9e8606544972b75cb628cfd9_WorldPosition_LOD0(inProtocolStream);
				case InternalArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_WorldPosition_LOD0:
					return WorldPosition.DeserializeArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_WorldPosition_LOD0(inProtocolStream);
				case InternalArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270_LOD0:
					return Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270.DeserializeArchetypeSprite__char_32_Potato_9695b90e9288dc943beda0d6f17570fe_Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270_LOD0(inProtocolStream);
				case InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldPosition_LOD0:
					return WorldPosition.DeserializeArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldPosition_LOD0(inProtocolStream);
				case InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldOrientation_LOD0:
					return WorldOrientation.DeserializeArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_WorldOrientation_LOD0(inProtocolStream);
				case InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_GenericScale_LOD0:
					return GenericScale.DeserializeArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_GenericScale_LOD0(inProtocolStream);
				case InternalArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250_LOD0:
					return Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250.DeserializeArchetypeSquare_59eb3b3a74ef2544cbd0bb383d729383_Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250_LOD0(inProtocolStream);
				default:
					return (null, 0, 0);
			}
		}

		public void WriteComponentUpdate(ICoherenceComponentData data, uint mask, 
			IOutProtocolBitStream protocolStream, Logger logger)
		{
			switch (data.GetComponentType())
			{
				case InternalWorldPosition:
					WorldPosition.Serialize((WorldPosition)data, mask, protocolStream);
					break;
				case InternalWorldOrientation:
					WorldOrientation.Serialize((WorldOrientation)data, mask, protocolStream);
					break;
				case InternalLocalUser:
					LocalUser.Serialize((LocalUser)data, mask, protocolStream);
					break;
				case InternalWorldPositionQuery:
					WorldPositionQuery.Serialize((WorldPositionQuery)data, mask, protocolStream);
					break;
				case InternalArchetypeComponent:
					ArchetypeComponent.Serialize((ArchetypeComponent)data, mask, protocolStream);
					break;
				case InternalPersistence:
					Persistence.Serialize((Persistence)data, mask, protocolStream);
					break;
				case InternalConnectedEntity:
					ConnectedEntity.Serialize((ConnectedEntity)data, mask, protocolStream);
					break;
				case InternalUniqueID:
					UniqueID.Serialize((UniqueID)data, mask, protocolStream);
					break;
				case InternalConnection:
					Connection.Serialize((Connection)data, mask, protocolStream);
					break;
				case InternalGlobal:
					Global.Serialize((Global)data, mask, protocolStream);
					break;
				case InternalGlobalQuery:
					GlobalQuery.Serialize((GlobalQuery)data, mask, protocolStream);
					break;
				case InternalTag:
					Tag.Serialize((Tag)data, mask, protocolStream);
					break;
				case InternalTagQuery:
					TagQuery.Serialize((TagQuery)data, mask, protocolStream);
					break;
				case InternalPreserveChildren:
					PreserveChildren.Serialize((PreserveChildren)data, mask, protocolStream);
					break;
				case InternalGenericPrefabReference:
					GenericPrefabReference.Serialize((GenericPrefabReference)data, mask, protocolStream);
					break;
				case InternalGenericPrefabId:
					GenericPrefabId.Serialize((GenericPrefabId)data, mask, protocolStream);
					break;
				case InternalGenericScale:
					GenericScale.Serialize((GenericScale)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt0:
					GenericFieldInt0.Serialize((GenericFieldInt0)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt1:
					GenericFieldInt1.Serialize((GenericFieldInt1)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt2:
					GenericFieldInt2.Serialize((GenericFieldInt2)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt3:
					GenericFieldInt3.Serialize((GenericFieldInt3)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt4:
					GenericFieldInt4.Serialize((GenericFieldInt4)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt5:
					GenericFieldInt5.Serialize((GenericFieldInt5)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt6:
					GenericFieldInt6.Serialize((GenericFieldInt6)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt7:
					GenericFieldInt7.Serialize((GenericFieldInt7)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt8:
					GenericFieldInt8.Serialize((GenericFieldInt8)data, mask, protocolStream);
					break;
				case InternalGenericFieldInt9:
					GenericFieldInt9.Serialize((GenericFieldInt9)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt0:
					GenericFieldUInt0.Serialize((GenericFieldUInt0)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt1:
					GenericFieldUInt1.Serialize((GenericFieldUInt1)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt2:
					GenericFieldUInt2.Serialize((GenericFieldUInt2)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt3:
					GenericFieldUInt3.Serialize((GenericFieldUInt3)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt4:
					GenericFieldUInt4.Serialize((GenericFieldUInt4)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt5:
					GenericFieldUInt5.Serialize((GenericFieldUInt5)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt6:
					GenericFieldUInt6.Serialize((GenericFieldUInt6)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt7:
					GenericFieldUInt7.Serialize((GenericFieldUInt7)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt8:
					GenericFieldUInt8.Serialize((GenericFieldUInt8)data, mask, protocolStream);
					break;
				case InternalGenericFieldUInt9:
					GenericFieldUInt9.Serialize((GenericFieldUInt9)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool0:
					GenericFieldBool0.Serialize((GenericFieldBool0)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool1:
					GenericFieldBool1.Serialize((GenericFieldBool1)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool2:
					GenericFieldBool2.Serialize((GenericFieldBool2)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool3:
					GenericFieldBool3.Serialize((GenericFieldBool3)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool4:
					GenericFieldBool4.Serialize((GenericFieldBool4)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool5:
					GenericFieldBool5.Serialize((GenericFieldBool5)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool6:
					GenericFieldBool6.Serialize((GenericFieldBool6)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool7:
					GenericFieldBool7.Serialize((GenericFieldBool7)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool8:
					GenericFieldBool8.Serialize((GenericFieldBool8)data, mask, protocolStream);
					break;
				case InternalGenericFieldBool9:
					GenericFieldBool9.Serialize((GenericFieldBool9)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat0:
					GenericFieldFloat0.Serialize((GenericFieldFloat0)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat1:
					GenericFieldFloat1.Serialize((GenericFieldFloat1)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat2:
					GenericFieldFloat2.Serialize((GenericFieldFloat2)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat3:
					GenericFieldFloat3.Serialize((GenericFieldFloat3)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat4:
					GenericFieldFloat4.Serialize((GenericFieldFloat4)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat5:
					GenericFieldFloat5.Serialize((GenericFieldFloat5)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat6:
					GenericFieldFloat6.Serialize((GenericFieldFloat6)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat7:
					GenericFieldFloat7.Serialize((GenericFieldFloat7)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat8:
					GenericFieldFloat8.Serialize((GenericFieldFloat8)data, mask, protocolStream);
					break;
				case InternalGenericFieldFloat9:
					GenericFieldFloat9.Serialize((GenericFieldFloat9)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble0:
					GenericFieldDouble0.Serialize((GenericFieldDouble0)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble1:
					GenericFieldDouble1.Serialize((GenericFieldDouble1)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble2:
					GenericFieldDouble2.Serialize((GenericFieldDouble2)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble3:
					GenericFieldDouble3.Serialize((GenericFieldDouble3)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble4:
					GenericFieldDouble4.Serialize((GenericFieldDouble4)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble5:
					GenericFieldDouble5.Serialize((GenericFieldDouble5)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble6:
					GenericFieldDouble6.Serialize((GenericFieldDouble6)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble7:
					GenericFieldDouble7.Serialize((GenericFieldDouble7)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble8:
					GenericFieldDouble8.Serialize((GenericFieldDouble8)data, mask, protocolStream);
					break;
				case InternalGenericFieldDouble9:
					GenericFieldDouble9.Serialize((GenericFieldDouble9)data, mask, protocolStream);
					break;
				case InternalGenericFieldVector0:
					GenericFieldVector0.Serialize((GenericFieldVector0)data, mask, protocolStream);
					break;
				case InternalGenericFieldVector1:
					GenericFieldVector1.Serialize((GenericFieldVector1)data, mask, protocolStream);
					break;
				case InternalGenericFieldVector2:
					GenericFieldVector2.Serialize((GenericFieldVector2)data, mask, protocolStream);
					break;
				case InternalGenericFieldVector3:
					GenericFieldVector3.Serialize((GenericFieldVector3)data, mask, protocolStream);
					break;
				case InternalGenericField2dVector0:
					GenericField2dVector0.Serialize((GenericField2dVector0)data, mask, protocolStream);
					break;
				case InternalGenericField2dVector1:
					GenericField2dVector1.Serialize((GenericField2dVector1)data, mask, protocolStream);
					break;
				case InternalGenericField2dVector2:
					GenericField2dVector2.Serialize((GenericField2dVector2)data, mask, protocolStream);
					break;
				case InternalGenericField2dVector3:
					GenericField2dVector3.Serialize((GenericField2dVector3)data, mask, protocolStream);
					break;
				case InternalGenericFieldString0:
					GenericFieldString0.Serialize((GenericFieldString0)data, mask, protocolStream);
					break;
				case InternalGenericFieldString1:
					GenericFieldString1.Serialize((GenericFieldString1)data, mask, protocolStream);
					break;
				case InternalGenericFieldString2:
					GenericFieldString2.Serialize((GenericFieldString2)data, mask, protocolStream);
					break;
				case InternalGenericFieldString3:
					GenericFieldString3.Serialize((GenericFieldString3)data, mask, protocolStream);
					break;
				case InternalGenericFieldString4:
					GenericFieldString4.Serialize((GenericFieldString4)data, mask, protocolStream);
					break;
				case InternalGenericFieldQuaternion0:
					GenericFieldQuaternion0.Serialize((GenericFieldQuaternion0)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity0:
					GenericFieldEntity0.Serialize((GenericFieldEntity0)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity1:
					GenericFieldEntity1.Serialize((GenericFieldEntity1)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity2:
					GenericFieldEntity2.Serialize((GenericFieldEntity2)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity3:
					GenericFieldEntity3.Serialize((GenericFieldEntity3)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity4:
					GenericFieldEntity4.Serialize((GenericFieldEntity4)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity5:
					GenericFieldEntity5.Serialize((GenericFieldEntity5)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity6:
					GenericFieldEntity6.Serialize((GenericFieldEntity6)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity7:
					GenericFieldEntity7.Serialize((GenericFieldEntity7)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity8:
					GenericFieldEntity8.Serialize((GenericFieldEntity8)data, mask, protocolStream);
					break;
				case InternalGenericFieldEntity9:
					GenericFieldEntity9.Serialize((GenericFieldEntity9)data, mask, protocolStream);
					break;
				case InternalGenericFieldBytes0:
					GenericFieldBytes0.Serialize((GenericFieldBytes0)data, mask, protocolStream);
					break;
				case InternalGenericFieldLong0:
					GenericFieldLong0.Serialize((GenericFieldLong0)data, mask, protocolStream);
					break;
				case InternalGenericFieldLong1:
					GenericFieldLong1.Serialize((GenericFieldLong1)data, mask, protocolStream);
					break;
				case InternalGenericFieldLong2:
					GenericFieldLong2.Serialize((GenericFieldLong2)data, mask, protocolStream);
					break;
				case InternalGenericFieldLong3:
					GenericFieldLong3.Serialize((GenericFieldLong3)data, mask, protocolStream);
					break;
				case InternalGenericFieldULong0:
					GenericFieldULong0.Serialize((GenericFieldULong0)data, mask, protocolStream);
					break;
				case InternalGenericFieldULong1:
					GenericFieldULong1.Serialize((GenericFieldULong1)data, mask, protocolStream);
					break;
				case InternalGenericFieldULong2:
					GenericFieldULong2.Serialize((GenericFieldULong2)data, mask, protocolStream);
					break;
				case InternalGenericFieldULong3:
					GenericFieldULong3.Serialize((GenericFieldULong3)data, mask, protocolStream);
					break;
				case InternalGenericFieldColor0:
					GenericFieldColor0.Serialize((GenericFieldColor0)data, mask, protocolStream);
					break;
				case InternalGenericFieldColor1:
					GenericFieldColor1.Serialize((GenericFieldColor1)data, mask, protocolStream);
					break;
				case InternalBackgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648:
					Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648.Serialize((Backgroud_UnityEngine__char_46_SpriteRenderer_6540651817069658648)data, mask, protocolStream);
					break;
				case InternalMiniGameManager_HotPotatoManager_8222345003895092174:
					MiniGameManager_HotPotatoManager_8222345003895092174.Serialize((MiniGameManager_HotPotatoManager_8222345003895092174)data, mask, protocolStream);
					break;
				case InternalSprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270:
					Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270.Serialize((Sprite__char_32_Potato_UnityEngine__char_46_SpriteRenderer_26267408122474270)data, mask, protocolStream);
					break;
				case InternalSquare_UnityEngine__char_46_SpriteRenderer_4692109573835368250:
					Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250.Serialize((Square_UnityEngine__char_46_SpriteRenderer_4692109573835368250)data, mask, protocolStream);
					break;
			}
		}

		private IEntityCommand ReadCommand(uint commandType, IInProtocolBitStream bitStream, Logger logger)
		{
			switch (commandType)
			{
				case Definition.InternalAuthorityRequest:
					return AuthorityRequest.Deserialize(bitStream);
				case Definition.InternalAuthorityTransfer:
					return AuthorityTransfer.Deserialize(bitStream);
				case Definition.InternalQuerySynced:
					return QuerySynced.Deserialize(bitStream);
				case Definition.InternalAdoptOrphan:
					return AdoptOrphan.Deserialize(bitStream);
				case Definition.InternalPersistenceReady:
					return PersistenceReady.Deserialize(bitStream);
				case Definition.InternalGenericCommand:
					return GenericCommand.Deserialize(bitStream);
				default:
					break;
			}

			return default;
		}

		private IEntityInput ReadInput(uint inputType, IInProtocolBitStream bitStream, Logger logger)
		{
			switch (inputType)
			{
				default:
					break;
			}

			return default;
		}

		public (IEntityCommand command, SerializeEntityID entityId, MessageTarget messageTarget)[]
			ReadCommands(IInBitStream bitStream, Logger logger)
		{
			var numMessages = bitStream.ReadUint8();

			var commandData = new (IEntityCommand command, SerializeEntityID entityId, MessageTarget messageTarget)[numMessages];

			for (var i = 0; i < numMessages; i++)
			{
				commandData[i].entityId = DeserializerTools.DeserializeEntityID(bitStream);
				commandData[i].messageTarget = DeserializerTools.DeserializeMessageTarget(bitStream);
				var componentType = DeserializerTools.DeserializeComponentTypeID(bitStream);
				var inBitStream = new Coherence.Serializer.InProtocolBitStream(bitStream);
				commandData[i].command = ReadCommand(componentType, inBitStream, logger);
			}

			return commandData;
		}

		public (IEntityInput input, long frame, SerializeEntityID entityId)[] 
			ReadInputs(IInBitStream bitStream, Logger logger)
		{
			var numMessages = bitStream.ReadUint8();

			var inputData = new (IEntityInput input, long frame, SerializeEntityID entityId)[numMessages];

			for (var i = 0; i < numMessages; i++)
			{
				inputData[i].entityId = DeserializerTools.DeserializeEntityID(bitStream);
				_ = DeserializerTools.DeserializeMessageTarget(bitStream);
				var componentType = DeserializerTools.DeserializeComponentTypeID(bitStream);
				var inBitStream = new Coherence.Serializer.InProtocolBitStream(bitStream);
				inputData[i].frame = (long)bitStream.ReadUint64();
				inputData[i].input = ReadInput(componentType, inBitStream, logger);
			}

			return inputData;
		}

		public void WriteCommand(IEntityCommand data, uint commandType, IOutProtocolBitStream bitStream, Logger logger)
		{
			switch (commandType)
			{
				case Definition.InternalAuthorityRequest:
					AuthorityRequest.Serialize((AuthorityRequest)data, bitStream);
					break;
				case Definition.InternalAuthorityTransfer:
					AuthorityTransfer.Serialize((AuthorityTransfer)data, bitStream);
					break;
				case Definition.InternalQuerySynced:
					QuerySynced.Serialize((QuerySynced)data, bitStream);
					break;
				case Definition.InternalAdoptOrphan:
					AdoptOrphan.Serialize((AdoptOrphan)data, bitStream);
					break;
				case Definition.InternalPersistenceReady:
					PersistenceReady.Serialize((PersistenceReady)data, bitStream);
					break;
				case Definition.InternalGenericCommand:
					GenericCommand.Serialize((GenericCommand)data, bitStream);
					break;
				default:
					break;
			}
		}

		public void WriteInput(IEntityInput data, uint inputType, IOutProtocolBitStream bitStream, Logger logger)
		{
			var inputData = (InputData)data;
			bitStream.WriteLong(inputData.Frame);

			switch (inputType)
			{
				default:
					break;
			}
		}

		public IEntityCommand CreateAuthorityRequest(ClientID requester, AuthorityType authType)
		{
			return new AuthorityRequest((uint)requester, (int)authType);
		}

		public IEntityCommand CreateAdoptOrphanCommand()
		{
			return new AdoptOrphan();
		}

		public bool TryGetAuthorityRequestCommand(IEntityCommand entityCommand, 
			out ClientID requester, out AuthorityType authType)
		{
			if (entityCommand is AuthorityRequest request) 
			{
				requester = (ClientID)request.requester;
				authType = (AuthorityType)request.authorityType;

				return true;
			}

			requester = default;
			authType = default;

			return false;
		}

		public IEntityCommand CreateAuthorityTransfer(ClientID newAuthority, bool accepted, AuthorityType authType)
		{
			return new AuthorityTransfer((uint)newAuthority, accepted, (int)authType);
		}

		public bool TryGetAuthorityTransferCommand(IEntityCommand entityCommand, out ClientID newAuthority,
			out bool transferAccepted, out AuthorityType authType) 
		{
			if (entityCommand is AuthorityTransfer transfer) 
			{
				newAuthority = (ClientID)transfer.newAuthority;
				transferAccepted = transfer.accepted;
				authType = (AuthorityType)transfer.authorityType;

				return true;
			}

			newAuthority = default;
			transferAccepted = default;
			authType = default;

			return false;
		}

		public ICoherenceComponentData GeneratePersistenceData()
		{
			var persistence = new Persistence();

			return persistence;
		}

		public ICoherenceComponentData GenerateCoherenceUUIDData(string uuid)
		{
			var uniqueID = new UniqueID();
			uniqueID.uuid = uuid;

			return uniqueID;
		}

		public ICoherenceComponentData GenerateGlobalQueryComponent()
		{
			return new GlobalQuery();
		}

		public string ExtractCoherenceUUID(ICoherenceComponentData data)
		{
			var uniqueID = (UniqueID)data;
			return uniqueID.uuid;
		}

		public bool IsConnectedEntity(ICoherenceComponentData data)
		{
			return data.GetComponentType() == Definition.InternalConnectedEntity;
		}

		public SerializeEntityID ExtractConnectedEntityID(ICoherenceComponentData data)
		{
			var connectedEntity = (ConnectedEntity)data;

			return connectedEntity.value;
		}

		public string ExtractCoherenceTag(ICoherenceComponentData data)
		{
			var tag = (Tag)data;
			return tag.tag;
		}
	}
}