Nez.Portable/ECS/Components/Renderables/RenderableComponent.cs
/// <Docs>To be added.</Docs>
/// <para>Returns the sort order of the current instance compared to the specified object.</para>
/// <summary>
/// sorted first by renderLayer, then layerDepth and finally material
/// </summary>
/// <returns>The to.</returns>
/// <param name="other">Other.</param>
sorted first by renderLayer, then layerDepth and finally material
sorted first by renderLayer then layerDepth and finally material
public int CompareTo(RenderableComponent other)
        {
            var res = other.renderLayer.CompareTo(renderLayer);
            if (res == 0)
            {
                res = other.layerDepth.CompareTo(layerDepth);
                if (res == 0)
                {
                    if (ReferenceEquals(material, other.material))
                        return 0;
                    if (other.material == null)
                        return -1;
                    return 1;
                }
            }
            return res;
        }
public int CompareTo ( RenderableComponent other ) { var res = other . renderLayer . CompareTo ( renderLayer ) ; if ( res == 0 ) { res = other . layerDepth . CompareTo ( layerDepth ) ; if ( res == 0 ) { if ( ReferenceEquals ( material , other . material ) ) return 0 ; if ( other . material == null ) return - 1 ; return 1 ; } } return res ; }
sorted first by renderLayer, then layerDepth and finally material
sorted first by renderLayer then layerDepth and finally material
// both null or equal
None
other
RenderableComponent
None
Docs
To be added.
To be added .
para
Returns the sort order of the current instance compared to the specified object.
Returns the sort order of the current instance compared to the specified object .