-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSFile.cs
More file actions
49 lines (42 loc) · 1.33 KB
/
SFile.cs
File metadata and controls
49 lines (42 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MaterialAndDaeFixerForAutobeam //realised I didnt need this so ignore lol
{
public class SFile : IEquatable<SFile>, IComparable<SFile>
{
public string SoundName { get; set; }
public int SoundRPM { get; set; }
public override bool Equals(object obj)
{
if (obj == null) return false;
SFile objAsSFile = obj as SFile;
if (objAsSFile == null) return false;
else return Equals(objAsSFile);
}
public int SortByNameAscending(string name1, string name2)
{
return name1.CompareTo(name2);
}
// Default comparer for SFile type.
public int CompareTo(SFile compareSFile)
{
// A null value means that this object is greater.
if (compareSFile == null)
return 1;
else
return this.SoundRPM.CompareTo(compareSFile.SoundRPM);
}
public override int GetHashCode()
{
return SoundRPM;
}
// Should also override == and != operators.
public bool Equals(SFile other)
{
if (other == null) return false;
return (this.SoundRPM.Equals(other.SoundRPM));
}
}
}