рр
This commit is contained in:
parent
52f3762b15
commit
22b5a1266c
@ -63,7 +63,7 @@ namespace ProjectTractor.Generics
|
||||
if (equal != null)
|
||||
{
|
||||
if (_places.Contains(tractor, equal))
|
||||
throw new ArgumentException(nameof(tractor));
|
||||
throw new ArgumentException("Такой " + nameof(tractor) + " уже существует");
|
||||
}
|
||||
_places.Insert(position, tractor);
|
||||
}
|
||||
|
@ -26,6 +26,11 @@ namespace ProjectTractor.Generics
|
||||
{
|
||||
return this.Name.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ namespace ProjectTractor
|
||||
{
|
||||
throw new IOException("Нет данных для загрузки");
|
||||
}
|
||||
if (!strings[0].StartsWith("BusStorages"))
|
||||
if (!strings[0].StartsWith("TractorStorages"))
|
||||
{
|
||||
throw new IOException("Неверный формат данных");
|
||||
}
|
||||
@ -160,10 +160,10 @@ namespace ProjectTractor
|
||||
string[] set = record[1].Split(_separatorRecords, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string elem in set)
|
||||
{
|
||||
DrawningTractor? bus = elem?.CreateDrawningTractor(_separatorForObject, _pictureWidth, _pictureHeight);
|
||||
if (bus != null)
|
||||
DrawningTractor? tractor = elem?.CreateDrawningTractor(_separatorForObject, _pictureWidth, _pictureHeight);
|
||||
if (tractor != null)
|
||||
{
|
||||
if (!(collection + bus))
|
||||
if (!(collection + tractor))
|
||||
{
|
||||
throw new IOException("Ошибка добавления в коллекцию");
|
||||
}
|
||||
|
3
RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/test.txt
Normal file
3
RPP_FirstLaba_Tractor/RPP_FirstLaba_Tractor/test.txt
Normal file
@ -0,0 +1,3 @@
|
||||
TractorStorages
|
||||
gggg|100:100:Purple;100:100:Black;100:100:Silver;100:100:White;100:100:Yellow;100:100:Blue;100:100:Green;100:100:Red;100:100:Blue:Yellow:True:True;
|
||||
|
@ -1,3 +0,0 @@
|
||||
TractorStorage
|
||||
gg|100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:White;100:100:Green:Purple:True:True;100:100:Yellow;100:100:White;
|
||||
|
Loading…
Reference in New Issue
Block a user