Compare commits
No commits in common. "8d7324d52e57bd92fd4430840f18b06018b9470c" and "08c17346146b2cca12d646406f35e480bf5eaf79" have entirely different histories.
8d7324d52e
...
08c1734614
@ -1,4 +1,5 @@
|
|||||||
using HoistingCrane.Drawning;
|
using HoistingCrane.Drawning;
|
||||||
|
using System;
|
||||||
namespace HoistingCrane.CollectionGenericObjects
|
namespace HoistingCrane.CollectionGenericObjects
|
||||||
{
|
{
|
||||||
public abstract class AbstractCompany
|
public abstract class AbstractCompany
|
||||||
@ -30,7 +31,7 @@ namespace HoistingCrane.CollectionGenericObjects
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (pictureWidth * pictureHeight) / (_placeSizeHeight * _placeSizeWidth)-3;
|
return (pictureWidth * pictureHeight) / (_placeSizeHeight * _placeSizeWidth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public AbstractCompany(int picWidth, int picHeight, ICollectionGenericObjects<DrawningTrackedVehicle> array)
|
public AbstractCompany(int picWidth, int picHeight, ICollectionGenericObjects<DrawningTrackedVehicle> array)
|
||||||
@ -74,6 +75,7 @@ namespace HoistingCrane.CollectionGenericObjects
|
|||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Вывод заднего фона
|
/// Вывод заднего фона
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
using HoistingCrane.Drawning;
|
using HoistingCrane.Drawning;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Specialized;
|
||||||
|
|
||||||
namespace HoistingCrane.CollectionGenericObjects
|
namespace HoistingCrane.CollectionGenericObjects
|
||||||
{
|
{
|
||||||
public class Garage : AbstractCompany
|
public class Garage : AbstractCompany
|
||||||
@ -35,7 +38,7 @@ namespace HoistingCrane.CollectionGenericObjects
|
|||||||
arr?.Get(i)?.SetPictureSize(pictureWidth, pictureHeight);
|
arr?.Get(i)?.SetPictureSize(pictureWidth, pictureHeight);
|
||||||
arr?.Get(i)?.SetPosition(_placeSizeWidth * currentPosWidth + 25, _placeSizeHeight * currentPosHeight + 15);
|
arr?.Get(i)?.SetPosition(_placeSizeWidth * currentPosWidth + 25, _placeSizeHeight * currentPosHeight + 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentPosWidth > 0)
|
if (currentPosWidth > 0)
|
||||||
currentPosWidth--;
|
currentPosWidth--;
|
||||||
else
|
else
|
||||||
@ -50,6 +53,5 @@ namespace HoistingCrane.CollectionGenericObjects
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
namespace HoistingCrane.CollectionGenericObjects
|
using System;
|
||||||
|
namespace HoistingCrane.CollectionGenericObjects
|
||||||
{
|
{
|
||||||
public interface ICollectionGenericObjects<T>
|
public interface ICollectionGenericObjects<T>
|
||||||
where T: class
|
where T: class
|
||||||
|
@ -8,7 +8,7 @@ namespace HoistingCrane.CollectionGenericObjects
|
|||||||
{
|
{
|
||||||
arr = Array.Empty<T?>();
|
arr = Array.Empty<T?>();
|
||||||
}
|
}
|
||||||
public int Count
|
public int Count
|
||||||
{
|
{
|
||||||
get { return arr.Length; }
|
get { return arr.Length; }
|
||||||
}
|
}
|
||||||
@ -31,11 +31,11 @@ namespace HoistingCrane.CollectionGenericObjects
|
|||||||
}
|
}
|
||||||
public T? Get(int position)
|
public T? Get(int position)
|
||||||
{
|
{
|
||||||
if (position >= 0 && position < arr.Length)
|
if(position >= 0 && position < arr.Length)
|
||||||
{
|
{
|
||||||
return arr[position];
|
return arr[position];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Insert(T obj)
|
public int Insert(T obj)
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
FieldWidth = width;
|
FieldWidth = width;
|
||||||
FieldHeight = height;
|
FieldHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Шаг перемещения
|
/// Шаг перемещения
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -118,6 +119,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected abstract bool IsTargetDestination();
|
protected abstract bool IsTargetDestination();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Попытка перемещения в требуемом направлении
|
/// Попытка перемещения в требуемом направлении
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
using System.Configuration;
|
namespace HoistingCrane.MovementStrategy
|
||||||
|
|
||||||
namespace HoistingCrane.MovementStrategy
|
|
||||||
{
|
{
|
||||||
public class MoveToBorder : AbstractStrategy
|
public class MoveToBorder : AbstractStrategy
|
||||||
{
|
{
|
||||||
@ -14,6 +12,7 @@ namespace HoistingCrane.MovementStrategy
|
|||||||
|
|
||||||
return objParams.RightBorder + GetStep() >= FieldWidth && objParams.DownBorder + GetStep() >= FieldHeight;
|
return objParams.RightBorder + GetStep() >= FieldWidth && objParams.DownBorder + GetStep() >= FieldHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void MoveToTarget()
|
protected override void MoveToTarget()
|
||||||
{
|
{
|
||||||
ObjectParameters? objParams = GetObjectParameters;
|
ObjectParameters? objParams = GetObjectParameters;
|
||||||
|
Loading…
Reference in New Issue
Block a user