diff --git a/HoistingCrane/HoistingCrane/CollectionGenericObjects/AbstractCompany.cs b/HoistingCrane/HoistingCrane/CollectionGenericObjects/AbstractCompany.cs index 4093c18..8bec219 100644 --- a/HoistingCrane/HoistingCrane/CollectionGenericObjects/AbstractCompany.cs +++ b/HoistingCrane/HoistingCrane/CollectionGenericObjects/AbstractCompany.cs @@ -1,5 +1,4 @@ using HoistingCrane.Drawning; -using System; namespace HoistingCrane.CollectionGenericObjects { public abstract class AbstractCompany @@ -31,7 +30,7 @@ namespace HoistingCrane.CollectionGenericObjects { get { - return (pictureWidth * pictureHeight) / (_placeSizeHeight * _placeSizeWidth); + return (pictureWidth * pictureHeight) / (_placeSizeHeight * _placeSizeWidth)-3; } } public AbstractCompany(int picWidth, int picHeight, ICollectionGenericObjects array) @@ -75,7 +74,6 @@ namespace HoistingCrane.CollectionGenericObjects } return bitmap; } - /// /// Вывод заднего фона /// diff --git a/HoistingCrane/HoistingCrane/CollectionGenericObjects/Garage.cs b/HoistingCrane/HoistingCrane/CollectionGenericObjects/Garage.cs index fc18cb7..6ba0162 100644 --- a/HoistingCrane/HoistingCrane/CollectionGenericObjects/Garage.cs +++ b/HoistingCrane/HoistingCrane/CollectionGenericObjects/Garage.cs @@ -1,7 +1,4 @@ using HoistingCrane.Drawning; -using System; -using System.Collections.Specialized; - namespace HoistingCrane.CollectionGenericObjects { public class Garage : AbstractCompany @@ -38,7 +35,7 @@ namespace HoistingCrane.CollectionGenericObjects arr?.Get(i)?.SetPictureSize(pictureWidth, pictureHeight); arr?.Get(i)?.SetPosition(_placeSizeWidth * currentPosWidth + 25, _placeSizeHeight * currentPosHeight + 15); } - + if (currentPosWidth > 0) currentPosWidth--; else @@ -53,5 +50,6 @@ namespace HoistingCrane.CollectionGenericObjects } } + } } diff --git a/HoistingCrane/HoistingCrane/CollectionGenericObjects/ICollectionGenericObjects.cs b/HoistingCrane/HoistingCrane/CollectionGenericObjects/ICollectionGenericObjects.cs index adc295a..007db42 100644 --- a/HoistingCrane/HoistingCrane/CollectionGenericObjects/ICollectionGenericObjects.cs +++ b/HoistingCrane/HoistingCrane/CollectionGenericObjects/ICollectionGenericObjects.cs @@ -1,5 +1,4 @@ -using System; -namespace HoistingCrane.CollectionGenericObjects +namespace HoistingCrane.CollectionGenericObjects { public interface ICollectionGenericObjects where T: class diff --git a/HoistingCrane/HoistingCrane/CollectionGenericObjects/MassivGenericObjects.cs b/HoistingCrane/HoistingCrane/CollectionGenericObjects/MassivGenericObjects.cs index cff3630..ed0e4fd 100644 --- a/HoistingCrane/HoistingCrane/CollectionGenericObjects/MassivGenericObjects.cs +++ b/HoistingCrane/HoistingCrane/CollectionGenericObjects/MassivGenericObjects.cs @@ -8,7 +8,7 @@ namespace HoistingCrane.CollectionGenericObjects { arr = Array.Empty(); } - public int Count + public int Count { get { return arr.Length; } } @@ -31,11 +31,11 @@ namespace HoistingCrane.CollectionGenericObjects } public T? Get(int position) { - if(position >= 0 && position < arr.Length) + if (position >= 0 && position < arr.Length) { return arr[position]; } - return null; + return null; } public int Insert(T obj) diff --git a/HoistingCrane/HoistingCrane/MovementStrategy/AbstractStrategy.cs b/HoistingCrane/HoistingCrane/MovementStrategy/AbstractStrategy.cs index 43e18e9..f8f3173 100644 --- a/HoistingCrane/HoistingCrane/MovementStrategy/AbstractStrategy.cs +++ b/HoistingCrane/HoistingCrane/MovementStrategy/AbstractStrategy.cs @@ -47,7 +47,6 @@ FieldWidth = width; FieldHeight = height; } - /// /// Шаг перемещения /// @@ -119,7 +118,6 @@ /// /// protected abstract bool IsTargetDestination(); - /// /// Попытка перемещения в требуемом направлении /// diff --git a/HoistingCrane/HoistingCrane/MovementStrategy/MoveToBorder.cs b/HoistingCrane/HoistingCrane/MovementStrategy/MoveToBorder.cs index 99cb56b..3d19b4d 100644 --- a/HoistingCrane/HoistingCrane/MovementStrategy/MoveToBorder.cs +++ b/HoistingCrane/HoistingCrane/MovementStrategy/MoveToBorder.cs @@ -1,4 +1,6 @@ -namespace HoistingCrane.MovementStrategy +using System.Configuration; + +namespace HoistingCrane.MovementStrategy { public class MoveToBorder : AbstractStrategy { @@ -12,7 +14,6 @@ return objParams.RightBorder + GetStep() >= FieldWidth && objParams.DownBorder + GetStep() >= FieldHeight; } - protected override void MoveToTarget() { ObjectParameters? objParams = GetObjectParameters;