コード例 #1
0
        /// <summary>
        /// Performs a <see cref="IAccessoryMounter.CanMount"/> check on the mounters and returns the index of the
        /// first one that returns true, or -1 if none was found.
        /// </summary>
        /// <param name="accessory">The accessory. (Required)</param>
        /// <param name="location">The location.</param>
        /// <param name="restrictions">The body converage restrictions.</param>
        /// <returns>The index of the mounter than can mount the accessory, or -1 if none was found.</returns>
        public int CanMount(Accessory accessory, MountPoint location, BodyCoverage restrictions)
        {
            for (int i = 0; i < Count; i++)
            {
                if (Accessory.CanMount(accessory, this[i], location, restrictions))
                {
                    return(i);
                }
            }

            return(-1);
        }
コード例 #2
0
        public sealed override bool CanMount(MountPointType locationType, BodyCoverage restrictions)
        {
            if (m_UseDefaultMounter)
            {
                return(true);
            }

            if (Accessory.CanMount(this, PriorityMounter, locationType, restrictions))
            {
                return(true);
            }

            return(m_Mounters.CanMount(this, locationType, restrictions) != -1);
        }
コード例 #3
0
        public sealed override bool CanMount(MountPoint location, BodyCoverage restrictions)
        {
            if (!location)
            {
                return(false);
            }

            if (Accessory.CanMount(this, PriorityMounter, location, restrictions))
            {
                return(true);
            }

            return(m_Mounters.CanMount(this, location, restrictions) != -1);
        }
コード例 #4
0
        public sealed override BodyCoverage GetCoverageFor(MountPointType locationType)
        {
            if (Accessory.CanMount(this, PriorityMounter, locationType, 0))
            {
                return(PriorityMounter.GetCoverageFor(locationType));
            }

            for (int i = 0; i < m_Mounters.Count; i++)
            {
                if (Accessory.CanMount(this, m_Mounters[i], locationType, 0))
                {
                    return(m_Mounters[i].GetCoverageFor(locationType));
                }
            }

            return(0);
        }