public static TComponent GetComponent <TComponent>(this ComponentEntity entity)
            where TComponent : Component
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            return(entity.Components.Get <TComponent>());
        }
        public static bool GetComponent <TComponent>(
            this ComponentEntity entity, [NotNullWhen(true)] out TComponent?component)
            where TComponent : Component
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }

            return(entity.Components.Get(out component));
        }
 protected Component(ComponentEntity entity)
 {
     Entity = entity ?? throw new ArgumentNullException(nameof(entity));
 }