-
Notifications
You must be signed in to change notification settings - Fork 7
/
PlayerChoice.cs
47 lines (37 loc) · 874 Bytes
/
PlayerChoice.cs
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
using System.Collections.Generic;
namespace Shockah.SeasonAffixes;
internal abstract class PlayerChoice
{
public sealed class Choice : PlayerChoice
{
public IReadOnlySet<ISeasonAffix> Affixes { get; init; }
public Choice(IReadOnlySet<ISeasonAffix> affixes)
{
this.Affixes = affixes;
}
public override bool Equals(object? obj)
=> obj is Choice other && Affixes.SetEquals(other.Affixes);
public override int GetHashCode()
{
int hash = 0;
foreach (var affix in Affixes)
hash ^= affix.GetHashCode();
return hash;
}
}
public sealed class Reroll : PlayerChoice
{
public static Reroll Instance { get; private set; } = new();
private Reroll()
{
}
}
public sealed class Invalid : PlayerChoice
{
public static Invalid Instance { get; private set; } = new();
private Invalid()
{
}
}
private PlayerChoice() { }
}