revert commit

This commit is contained in:
prodigygirl 2022-11-30 15:22:10 +04:00
parent 45788afb0f
commit 439dbefe6e
2 changed files with 7 additions and 14 deletions

View File

@ -176,8 +176,8 @@ namespace ArmoredCar
int k = 0;
foreach (var armoredCar in _setCars.GetCars())
{
armoredCar?.SetObject(k % width * _placeSizeWidth + 5, k / width * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
armoredCar?.DrawningObject(g);
armoredCar.SetObject(k % width * _placeSizeWidth + 5, k / width * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
armoredCar.DrawningObject(g);
k++;
}
}
@ -191,10 +191,7 @@ namespace ArmoredCar
string data = $"{_map.GetType().Name}{separatorType}";
foreach (var armoredCar in _setCars.GetCars())
{
if (armoredCar != null)
data += $"{armoredCar.GetInfo()}{separatorData}";
else
data += $"null{separatorData}";
data += $"{armoredCar.GetInfo()}{separatorData}";
}
return data;
}
@ -206,10 +203,7 @@ namespace ArmoredCar
{
foreach (var rec in records)
{
if (rec != "null")
_setCars.Insert(DrawningObjectArmCar.Create(rec) as T);
else
_setCars.Insert(null);
_setCars.Insert(DrawningObjectArmCar.Create(rec) as T);
}
}
}

View File

@ -65,7 +65,7 @@ namespace ArmoredCar
T armoredCar = _places[position];
if (armoredCar == null)
throw new ArmoredCarNotFoundException(position);
_places[position] = null;
_places.RemoveAt(position);
return armoredCar;
}
/// <summary>
@ -98,15 +98,14 @@ namespace ArmoredCar
{
foreach (var car in _places)
{
yield return car;
/*if (car != null)
if (car != null)
{
yield return car;
}
else
{
yield break;
}*/
}
}
}