Created
October 17, 2020 05:01
-
-
Save MelbourneDeveloper/b51c1ba76584c9e0d6926559bce546ad to your computer and use it in GitHub Desktop.
F# Point Record as C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using Microsoft.FSharp.Core; | |
namespace FSharpLibrary | |
{ | |
// Token: 0x02000002 RID: 2 | |
[CompilationMapping(SourceConstructFlags.RecordType)] | |
[Serializable] | |
public sealed class Point : IEquatable<Point>, IStructuralEquatable, IComparable<Point>, IComparable, IStructuralComparable | |
{ | |
// Token: 0x17000001 RID: 1 | |
// (get) Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250 | |
[CompilationMapping(SourceConstructFlags.Field, 0)] | |
public int X | |
{ | |
get | |
{ | |
return this.X@; | |
} | |
} | |
// Token: 0x17000002 RID: 2 | |
// (get) Token: 0x06000002 RID: 2 RVA: 0x00002058 File Offset: 0x00000258 | |
[CompilationMapping(SourceConstructFlags.Field, 1)] | |
public int Y | |
{ | |
get | |
{ | |
return this.Y@; | |
} | |
} | |
// Token: 0x17000003 RID: 3 | |
// (get) Token: 0x06000003 RID: 3 RVA: 0x00002060 File Offset: 0x00000260 | |
[CompilationMapping(SourceConstructFlags.Field, 2)] | |
public int Z | |
{ | |
get | |
{ | |
return this.Z@; | |
} | |
} | |
// Token: 0x06000004 RID: 4 RVA: 0x00002068 File Offset: 0x00000268 | |
public Point(int x, int y, int z) | |
{ | |
this.X@ = x; | |
this.Y@ = y; | |
this.Z@ = z; | |
} | |
// Token: 0x06000005 RID: 5 RVA: 0x00002088 File Offset: 0x00000288 | |
[CompilerGenerated] | |
public override string ToString() | |
{ | |
return ExtraTopLevelOperators.PrintFormatToString<FSharpFunc<Point, string>>(new PrintfFormat<FSharpFunc<Point, string>, Unit, string, string, Point>("%+A")).Invoke(this); | |
} | |
// Token: 0x06000006 RID: 6 RVA: 0x000020A0 File Offset: 0x000002A0 | |
[CompilerGenerated] | |
public sealed int CompareTo(Point obj) | |
{ | |
if (this != null) | |
{ | |
if (obj == null) | |
{ | |
return 1; | |
} | |
IComparer genericComparer = LanguagePrimitives.GenericComparer; | |
int x@ = this.X@; | |
int x@2 = obj.X@; | |
int num = (x@ >= x@2) ? ((x@ > x@2) ? 1 : 0) : -1; | |
if (num < 0) | |
{ | |
return num; | |
} | |
if (num > 0) | |
{ | |
return num; | |
} | |
IComparer genericComparer2 = LanguagePrimitives.GenericComparer; | |
int y@ = this.Y@; | |
int y@2 = obj.Y@; | |
int num2 = (y@ >= y@2) ? ((y@ > y@2) ? 1 : 0) : -1; | |
if (num2 < 0) | |
{ | |
return num2; | |
} | |
if (num2 > 0) | |
{ | |
return num2; | |
} | |
IComparer genericComparer3 = LanguagePrimitives.GenericComparer; | |
int z@ = this.Z@; | |
int z@2 = obj.Z@; | |
if (z@ < z@2) | |
{ | |
return -1; | |
} | |
return (z@ > z@2) ? 1 : 0; | |
} | |
else | |
{ | |
if (obj != null) | |
{ | |
return -1; | |
} | |
return 0; | |
} | |
} | |
// Token: 0x06000007 RID: 7 RVA: 0x00002180 File Offset: 0x00000380 | |
[CompilerGenerated] | |
public sealed int CompareTo(object obj) | |
{ | |
return this.CompareTo((Point)obj); | |
} | |
// Token: 0x06000008 RID: 8 RVA: 0x00002190 File Offset: 0x00000390 | |
[CompilerGenerated] | |
public sealed int CompareTo(object obj, IComparer comp) | |
{ | |
Point point = (Point)obj; | |
Point point2 = point; | |
if (this != null) | |
{ | |
if ((Point)obj == null) | |
{ | |
return 1; | |
} | |
int x@ = this.X@; | |
int x@2 = point2.X@; | |
int num = (x@ >= x@2) ? ((x@ > x@2) ? 1 : 0) : -1; | |
if (num < 0) | |
{ | |
return num; | |
} | |
if (num > 0) | |
{ | |
return num; | |
} | |
int y@ = this.Y@; | |
int y@2 = point2.Y@; | |
int num2 = (y@ >= y@2) ? ((y@ > y@2) ? 1 : 0) : -1; | |
if (num2 < 0) | |
{ | |
return num2; | |
} | |
if (num2 > 0) | |
{ | |
return num2; | |
} | |
int z@ = this.Z@; | |
int z@2 = point2.Z@; | |
if (z@ < z@2) | |
{ | |
return -1; | |
} | |
return (z@ > z@2) ? 1 : 0; | |
} | |
else | |
{ | |
if ((Point)obj != null) | |
{ | |
return -1; | |
} | |
return 0; | |
} | |
} | |
// Token: 0x06000009 RID: 9 RVA: 0x00002280 File Offset: 0x00000480 | |
[CompilerGenerated] | |
public sealed int GetHashCode(IEqualityComparer comp) | |
{ | |
if (this != null) | |
{ | |
int num = 0; | |
num = -1640531527 + (this.Z@ + ((num << 6) + (num >> 2))); | |
num = -1640531527 + (this.Y@ + ((num << 6) + (num >> 2))); | |
return -1640531527 + (this.X@ + ((num << 6) + (num >> 2))); | |
} | |
return 0; | |
} | |
// Token: 0x0600000A RID: 10 RVA: 0x000022E4 File Offset: 0x000004E4 | |
[CompilerGenerated] | |
public sealed override int GetHashCode() | |
{ | |
return this.GetHashCode(LanguagePrimitives.GenericEqualityComparer); | |
} | |
// Token: 0x0600000B RID: 11 RVA: 0x000022F4 File Offset: 0x000004F4 | |
[CompilerGenerated] | |
public sealed bool Equals(object obj, IEqualityComparer comp) | |
{ | |
if (this == null) | |
{ | |
return obj == null; | |
} | |
Point point = obj as Point; | |
if (point != null) | |
{ | |
Point point2 = point; | |
return this.X@ == point2.X@ && this.Y@ == point2.Y@ && this.Z@ == point2.Z@; | |
} | |
return false; | |
} | |
// Token: 0x0600000C RID: 12 RVA: 0x00002368 File Offset: 0x00000568 | |
[CompilerGenerated] | |
public sealed override bool Equals(Point obj) | |
{ | |
if (this != null) | |
{ | |
return obj != null && this.X@ == obj.X@ && this.Y@ == obj.Y@ && this.Z@ == obj.Z@; | |
} | |
return obj == null; | |
} | |
// Token: 0x0600000D RID: 13 RVA: 0x000023CC File Offset: 0x000005CC | |
[CompilerGenerated] | |
public sealed override bool Equals(object obj) | |
{ | |
Point point = obj as Point; | |
return point != null && this.Equals(point); | |
} | |
// Token: 0x04000001 RID: 1 | |
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | |
internal int X@; | |
// Token: 0x04000002 RID: 2 | |
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | |
internal int Y@; | |
// Token: 0x04000003 RID: 3 | |
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | |
internal int Z@; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment