update MaterialCompareTo to compare the reference hash code instead of equaling the reference
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
Imports System.Numerics
|
Imports System.Numerics
|
||||||
|
|
||||||
Public Class Material
|
Public Class Material
|
||||||
Implements IComparable
|
Implements IComparable(Of Material)
|
||||||
|
|
||||||
Public Property Image As Image = Nothing
|
Public Property Image As Image = Nothing
|
||||||
Public Property Color As Color? = Nothing
|
Public Property Color As Color? = Nothing
|
||||||
@@ -10,16 +10,11 @@ Public Class Material
|
|||||||
Public Property Scale As New Vector2(1.0F, 1.0F)
|
Public Property Scale As New Vector2(1.0F, 1.0F)
|
||||||
Public Property Tag As Object = Nothing
|
Public Property Tag As Object = Nothing
|
||||||
|
|
||||||
Public Function CompareTo(obj As Object) As Integer Implements IComparable.CompareTo
|
Public Function CompareTo(obj As Material) As Integer Implements IComparable(Of Material).CompareTo
|
||||||
If obj IsNot Nothing Then
|
'If obj Is Me Then Return 0
|
||||||
If obj Is Me Then
|
'If obj Is Nothing Then Return 1
|
||||||
Return 0
|
'Return -1
|
||||||
Else
|
Return GetHashCode() - If(obj?.GetHashCode, 0)
|
||||||
Return -1
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
Return 1
|
|
||||||
End If
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user