PIbd-21_Putintsev_D.M._Road.../RoadTrain/TrainsCollectionInfo.cs

30 lines
766 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RoadTrain
{
internal class TrainsCollectionInfo : IEquatable<TrainsCollectionInfo>
{
public string Name { get; private set; }
public string Description { get; private set; }
public TrainsCollectionInfo(string name, string description)
{
Name = name;
Description = description;
}
public bool Equals(TrainsCollectionInfo? other)
{
if (other == null)
return false;
return other.Name == Name;
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
}
}