/// <summary>
        ///     Convenience method for dispatching the supplied op to the
        ///     appropriate method in the entity pipeline block.
        /// </summary>
        /// <exception cref="ArgumentException">
        ///     Thrown when op object is of an unrecognised type.
        /// </exception>
        public static void DispatchOp(this IEntityPipelineBlock block, IEntityPipelineOp pipelineOp)
        {
            switch (pipelineOp.PipelineOpType)
            {
            case PipelineOpType.AddEntity:
                block.AddEntity((AddEntityPipelineOp)pipelineOp);
                break;

            case PipelineOpType.RemoveEntity:
                block.RemoveEntity((RemoveEntityPipelineOp)pipelineOp);
                break;

            case PipelineOpType.CriticalSection:
                block.CriticalSection((CriticalSectionPipelineOp)pipelineOp);
                break;

            case PipelineOpType.AddComponent:
                block.AddComponent((AddComponentPipelineOp)pipelineOp);
                break;

            case PipelineOpType.RemoveComponent:
                block.RemoveComponent((RemoveComponentPipelineOp)pipelineOp);
                break;

            case PipelineOpType.ChangeAuthority:
                block.ChangeAuthority((ChangeAuthorityPipelineOp)pipelineOp);
                break;

            case PipelineOpType.UpdateComponent:
                block.UpdateComponent((UpdateComponentPipelineOp)pipelineOp);
                break;

            default:
                throw new ArgumentException(string.Format("Unknown op type {0}, cannot dispatch.", pipelineOp.GetType().Name), "op");
            }
        }
 internal void RemoveComponent(EntityId entityId, IComponentMetaclass componentMetaclass, object component)
 {
     block.RemoveComponent(new RemoveComponentPipelineOp {
         EntityId = entityId, ComponentMetaClass = componentMetaclass, ComponentObject = component
     });
 }