예제 #1
0
        /***************************************************/
        /**** IComparable Interface                     ****/
        /***************************************************/

        public int CompareTo(IResult other)
        {
            MeshResult otherRes = other as MeshResult;

            if (otherRes == null)
            {
                return(this.GetType().Name.CompareTo(other.GetType().Name));
            }

            int n = this.ObjectId.CompareTo(otherRes.ObjectId);

            if (n == 0)
            {
                int l = this.ResultCase.CompareTo(otherRes.ResultCase);
                return(l == 0 ? this.TimeStep.CompareTo(otherRes.TimeStep) : l);
            }
            else
            {
                return(n);
            }
        }
예제 #2
0
파일: MeshResult.cs 프로젝트: tmakin/BHoM
        /***************************************************/
        /**** IComparable Interface                     ****/
        /***************************************************/

        public int CompareTo(IResult other)
        {
            MeshResult otherRes = other as MeshResult;

            if (otherRes == null)
            {
                return(this.GetType().Name.CompareTo(other.GetType().Name));
            }

            int objectId = this.ObjectId.CompareTo(otherRes.ObjectId);

            if (objectId == 0)
            {
                int loadcase = this.ResultCase.CompareTo(otherRes.ResultCase);
                if (loadcase == 0)
                {
                    int meshFaceId = this.MeshFaceId.CompareTo(otherRes.MeshFaceId);
                    if (meshFaceId == 0)
                    {
                        int nodeId = this.NodeId.CompareTo(otherRes.NodeId);
                        return(nodeId == 0 ? this.TimeStep.CompareTo(otherRes.TimeStep) : nodeId);
                    }
                    else
                    {
                        return(meshFaceId);
                    }
                }
                else
                {
                    return(loadcase);
                }
            }
            else
            {
                return(objectId);
            }
        }