コード例 #1
0
 /// <summary>
 /// Checks whether this attachment supports the given operation
 /// 
 /// Note that all attachments define all of the operations, but this
 /// method is instead intended to provide a 'hint' as to whether or not this
 /// attachment does anything meaningful during that operation
 /// </summary>
 /// <param name="operation">The operation to check for</param>
 /// <returns>True if this attachment supports the operation, else false</returns>
 public abstract bool Supports(SceneNodeOperation operation);
コード例 #2
0
        /// <summary>
        /// Checks whether this attachment supports the given operation
        /// 
        /// Note that all attachments define all of the operations, but this
        /// method is instead intended to provide a 'hint' as to whether or not this
        /// attachment does anything meaningful during that operation
        /// </summary>
        /// <param name="operation">The operation to check for</param>
        /// <returns>True if this attachment supports the operation, else false</returns>
        public override bool Supports(SceneNodeOperation operation)
        {
            bool doesSupport = false;

            // Check to see if the operation is supported
            switch (operation)
            {
                case SceneNodeOperation.Render:
                case SceneNodeOperation.Update:
                    doesSupport = true;
                    break;
                default:
                    doesSupport = false;
                    break;
            }

            return doesSupport;
        }
コード例 #3
0
        /// <summary>
        /// Retrieves a list of all attachments supporting a given scene-node operation
        /// </summary>
        /// <param name="operation">The operation to query for</param>
        /// <returns></returns>
        public List<SceneNodeAttachment> FindAttachmentsSupporting(SceneNodeOperation operation)
        {
            List<SceneNodeAttachment> attachments = new List<SceneNodeAttachment>();

            // Check through all attachments for any supporting the operation
            foreach (SceneNodeAttachment attachment in _attachments)
            {
                if (attachment.Supports(operation))
                {
                    attachments.Add(attachment);
                }
            }

            return attachments;
        }