-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigimonListEntry.cs
More file actions
56 lines (48 loc) · 1.49 KB
/
DigimonListEntry.cs
File metadata and controls
56 lines (48 loc) · 1.49 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
50
51
52
53
54
55
56
using System.Diagnostics.CodeAnalysis;
namespace Cyber_Sleuth_Mod_Evolution_Analyzer
{
public class DigimonListEntry : IComparable
{
public readonly Digimon Digimon;
public readonly List<string> Devolutions;
public readonly List<string> Evolutions;
public DigimonListEntry(Digimon digimon, List<string> devolutions, List<string> evolutions)
{
Digimon = digimon;
Devolutions = devolutions;
Evolutions = evolutions;
}
public DigimonListEntry()
{
Digimon = new Digimon();
Devolutions = new List<string>();
Evolutions = new List<string>();
}
public override string ToString()
{
return Digimon.ToString() + " -{ D:"
+ Devolutions.Count.ToString() + "; E:"
+ Evolutions.Count.ToString() + " }-";
}
public int CompareTo(object? obj)
{
if (obj == null)
{
return 0;
}
var other = (obj as DigimonListEntry)!;
return Digimon.CompareTo(other.Digimon);
}
}
public static class DigimonListEntryExtension
{
public static bool IsNullOrEmpty([NotNullWhen(false)] this DigimonListEntry? dle)
{
if (dle == null || dle.Digimon == null || String.IsNullOrEmpty(dle.Digimon.ID))
{
return true;
}
return false;
}
}
}