PIbd-23_Vrazhkin_S_A_Electr.../lab1/Generics/LocomotivCollectionInfo.cs

22 lines
539 B
C#
Raw Normal View History

2023-12-12 13:58:32 +04:00
namespace ElectricLocomotive;
public class LocomotivCollectionInfo : IEquatable<LocomotivCollectionInfo>
{
public string Name { get; private set; }
public string Description { get; private set; }
public LocomotivCollectionInfo(string name, string description)
{
Name = name;
Description = description;
}
public bool Equals(LocomotivCollectionInfo? other)
{
return Name == other.Name;
}
public override int GetHashCode()
{
return this.Name.GetHashCode();
}
}