ARCed.Core.GameResource.CompareTo C# (CSharp) Method

CompareTo() public method

Compares two GameResource objects. Local resources are listed first, names are sorted alphabetically within their location.
Thrown when object to compare is not a GameResource
public CompareTo ( object other ) : int
other object GameResource object to compare
return int
        public int CompareTo(object other)
        {
            GameResource rsx;
            if (other is GameResource)
                rsx = other as GameResource;
            else
                throw new ArgumentException("Object is not of type \"GameResource\"");
            if (this.Location == Location.Local && rsx.Location != Location.Local)
                return -1;
            if (this.Location == Location.RTP && rsx.Location == Location.Local)
                return 1;
            return String.Compare(this.Name, rsx.Name, StringComparison.Ordinal);
        }