PKHeX/PKHeX.Core/Legality/RNG/Locks/TeamLock.cs
Kurt 65c5890e1f Make NPCLock a readonly struct
Reduces allocation, improves locality of data since the contents take less size than a pointer (can pass byval)
2021-08-21 17:44:43 -07:00

30 lines
771 B
C#

namespace PKHeX.Core
{
public sealed class TeamLock
{
public readonly int Species;
public readonly string Comment;
public readonly NPCLock[] Locks;
public TeamLock(int species, NPCLock[] locks)
{
Species = species;
Locks = locks;
Comment = string.Empty;
}
public TeamLock(int species, string comment, NPCLock[] locks)
{
Species = species;
Locks = locks;
Comment = comment;
}
public override string ToString()
{
if (Comment.Length == 0)
return $"{(Species)Species} [{Locks.Length}]";
return $"{(Species)Species} [{Locks.Length}] - {Comment}";
}
}
}