Лабараторная работа №3 3
This commit is contained in:
parent
0c3397fcee
commit
1460d8e2a0
@ -23,7 +23,7 @@ public abstract class AbstractCompany
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Коллекция судов
|
/// Коллекция судов
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICollectionGenericObjects<DrawningShip>? _collection = null;
|
protected ICollectionGenericObjects<DrawningShip>? _collection = null;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Вычисление максимального количества элементов, который можно разместить в окне
|
/// Вычисление максимального количества элементов, который можно разместить в окне
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -8,7 +8,6 @@ public class ShipPortService : AbstractCompany
|
|||||||
public ShipPortService(int picWidth, int picHeight, ICollectionGenericObjects<DrawningShip> collection) : base(picWidth, picHeight, collection)
|
public ShipPortService(int picWidth, int picHeight, ICollectionGenericObjects<DrawningShip> collection) : base(picWidth, picHeight, collection)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void DrawBackgound(Graphics g)
|
protected override void DrawBackgound(Graphics g)
|
||||||
{
|
{
|
||||||
//рисуем пристань
|
//рисуем пристань
|
||||||
@ -23,7 +22,6 @@ public class ShipPortService : AbstractCompany
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetObjectsPosition()
|
protected override void SetObjectsPosition()
|
||||||
{
|
{
|
||||||
int width = _pictureWidth / _placeSizeWidth;
|
int width = _pictureWidth / _placeSizeWidth;
|
||||||
|
@ -67,12 +67,10 @@ public partial class FormShipCollection : Form
|
|||||||
{
|
{
|
||||||
CreateObject(nameof(DrawningShip));
|
CreateObject(nameof(DrawningShip));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonAddWarmlyShip_Click(object sender, EventArgs e)
|
private void buttonAddWarmlyShip_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CreateObject(nameof(DrawningWarmlyShip));
|
CreateObject(nameof(DrawningWarmlyShip));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonRemoveShip_Click(object sender, EventArgs e)
|
private void buttonRemoveShip_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(maskedTextBox.Text) || _company == null)
|
if (string.IsNullOrEmpty(maskedTextBox.Text) || _company == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user