예제 #1
0
        /// <summary>
        /// Creates instance with provided joint information
        /// </summary>
        /// <param name="_JointType">Type of this joint</param>
        /// <param name="_JointPosition">Position of this joint in piece</param>
        /// <param name="_JointWidth">Width of this joint</param>
        /// <param name="_JointHeight">Height of this joint</param>
        public SJointInfo(EJointType _JointType, EJointPosition _JointPosition, int _JointWidth, int _JointHeight)
        {
            _jointType     = _JointType;
            _jointPosition = _JointPosition;

            _jointWidth  = _JointWidth;
            _jointHeight = _JointHeight;
        }
예제 #2
0
        /// <summary>
        /// Creates instance with provided joint information
        /// </summary>
        /// <param name="_JointType">Type of this joint</param>
        /// <param name="_JointPosition">Position of this joint in piece</param>
        /// <param name="_JointWidth">Width of this joint</param>
        /// <param name="_JointHeight">Height of this joint</param>
        public SJointInfo(EJointType _JointType, EJointPosition _JointPosition, int _JointWidth, int _JointHeight)
        {
            _jointType = _JointType;
            _jointPosition = _JointPosition;

            _jointWidth = _JointWidth;
            _jointHeight = _JointHeight;
        }
예제 #3
0
        /// <summary>
        /// Checks for existance of provided joint position
        /// </summary>
        /// <param name="Joint">Joint position to check for in this piece</param>
        /// <returns>Returns true if provided joint position is occupied by a joint</returns>
        public bool HaveJoint(EJointPosition Joint)
        {
            for (int i = 0; i < _Joints.Count; i++)
            {
                if (_Joints[i].JointPosition == Joint)
                    return true;
            }

            return false;
        }
예제 #4
0
        /// <summary>
        /// Checks for existance of provided joint position
        /// </summary>
        /// <param name="Joint">Joint position to check for in this piece</param>
        /// <returns>Returns true if provided joint position is occupied by a joint</returns>
        public bool HaveJoint(EJointPosition Joint)
        {
            for (int i = 0; i < _Joints.Count; i++)
            {
                if (_Joints[i].JointPosition == Joint)
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #5
0
        /// <summary>
        /// Gets joint information according to provided joint position
        /// </summary>
        /// <param name="i"></param>
        /// <returns>Returns joint info, throws argument exception on piece not found</returns>
        public SJointInfo this[EJointPosition i]
        {

            get
            {
                foreach (SJointInfo item in _Joints)
                {
                    if (item.JointPosition == i)
                        return item;
                }

                throw new System.ArgumentException("Joint with provided JointPosition not found");
            }

        }
예제 #6
0
        /// <summary>
        /// Gets joint information according to provided joint position
        /// </summary>
        /// <param name="i"></param>
        /// <returns>Returns joint info, throws argument exception on piece not found</returns>
        public SJointInfo this[EJointPosition i]
        {
            get
            {
                foreach (SJointInfo item in _Joints)
                {
                    if (item.JointPosition == i)
                    {
                        return(item);
                    }
                }

                throw new System.ArgumentException("Joint with provided JointPosition not found");
            }
        }
예제 #7
0
        /// <summary>
        /// Returns joint information based on joint position.
        /// </summary>
        /// <param name="Joint">Joint position to return data for</param>
        /// <param name="IsFound">an out variable, true if joint is found false otherwise</param>
        /// <returns>Returns joint information of joint at provided joint position</returns>
        public SJointInfo GetJoint(EJointPosition Joint, out bool IsFound)
        {
            SJointInfo Result = new SJointInfo();

            foreach (SJointInfo item in _Joints)
            {
                if (item.JointPosition == Joint)
                {
                    Result  = new SJointInfo(item.JointType, item.JointPosition, item.JointWidth, item.JointHeight);
                    IsFound = true;

                    return(Result);
                }
            }

            IsFound = false;

            return(Result);
        }
예제 #8
0
        public SJointInfo GetJoint(EJointPosition Joint, out bool IsFound)
        {
            SJointInfo Result = new SJointInfo();

            foreach (SJointInfo item in _Joints)
            {
                if (item.JointPosition == Joint)
                {
                    Result = new SJointInfo(item.JointType, item.JointPosition, item.JointWidth, item.JointHeight);
                    IsFound = true;

                    return Result;
                }
            }

            IsFound = false;

            return Result;
        }