Skip to content

Commit 7fad74a

Browse files
committed
ColorId is comparable
1 parent 46c665c commit 7fad74a

File tree

2 files changed

+23
-755
lines changed

2 files changed

+23
-755
lines changed
Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
using System.Windows.Media;
1+
using System.Numerics;
2+
using System.Windows.Media;
23

3-
namespace OngekiFumenEditor.Base.OngekiObjects
4+
namespace OngekiFumenEditor.Base.OngekiObjects;
5+
6+
public struct ColorId : IEqualityOperators<ColorId, ColorId, bool>
47
{
5-
public struct ColorId
6-
{
7-
public int Id { get; set; }
8-
public string Name { get; set; }
9-
public Color Color { get; set; }
10-
11-
public override string ToString() => $"{Id} {Name}";
12-
}
8+
public int Id { get; set; }
9+
public string Name { get; set; }
10+
public Color Color { get; set; }
11+
12+
public override string ToString()
13+
{
14+
return $"{Id} {Name}";
15+
}
16+
17+
public static bool operator ==(ColorId left, ColorId right)
18+
{
19+
return left.Id == right.Id;
20+
}
21+
22+
public static bool operator !=(ColorId left, ColorId right)
23+
{
24+
return !(left == right);
25+
}
1326
}

0 commit comments

Comments
 (0)