доработка формы
This commit is contained in:
parent
dc0e0bde72
commit
939e4130a9
@ -164,7 +164,8 @@
|
||||
//
|
||||
this.comboBoxSelectorMap.FormattingEnabled = true;
|
||||
this.comboBoxSelectorMap.Items.AddRange(new object[] {
|
||||
"Простая карта"});
|
||||
"Простая карта",
|
||||
"Океан"});
|
||||
this.comboBoxSelectorMap.Location = new System.Drawing.Point(6, 26);
|
||||
this.comboBoxSelectorMap.Name = "comboBoxSelectorMap";
|
||||
this.comboBoxSelectorMap.Size = new System.Drawing.Size(238, 28);
|
||||
|
@ -32,6 +32,9 @@ namespace WarmlyShip
|
||||
case "Простая карта":
|
||||
map = new SimpleMap();
|
||||
break;
|
||||
case "Океан":
|
||||
map = new OceanMap();
|
||||
break;
|
||||
}
|
||||
if (map != null)
|
||||
{
|
||||
@ -58,14 +61,14 @@ namespace WarmlyShip
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
DrawningObjectShip ship = new(form.SelectedShip);
|
||||
if (_mapShipsCollectionGeneric + ship)
|
||||
if (form.SelectedShip == null || !(_mapShipsCollectionGeneric + ship))
|
||||
{
|
||||
MessageBox.Show("Объект добавлен");
|
||||
pictureBox.Image = _mapShipsCollectionGeneric.ShowSet();
|
||||
MessageBox.Show("Не удалось добавить объект");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Не удалось добавить объект");
|
||||
MessageBox.Show("Объект добавлен");
|
||||
pictureBox.Image = _mapShipsCollectionGeneric.ShowSet();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ namespace WarmlyShip
|
||||
/// <summary>
|
||||
/// Размер занимаемого объектом места (ширина)
|
||||
/// </summary>
|
||||
private readonly int _placeSizeWidth = 210;
|
||||
private readonly int _placeSizeWidth = 180;
|
||||
/// <summary>
|
||||
/// Размер занимаемого объектом места (высота)
|
||||
/// </summary>
|
||||
private readonly int _placeSizeHeight = 90;
|
||||
private readonly int _placeSizeHeight = 120;
|
||||
/// <summary>
|
||||
/// Набор объектов
|
||||
/// </summary>
|
||||
@ -144,6 +144,14 @@ namespace WarmlyShip
|
||||
/// <param name="g"></param>
|
||||
private void DrawBackground(Graphics g)
|
||||
{
|
||||
for (int x = 0; x < _pictureWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < _pictureWidth; y++)
|
||||
{
|
||||
Brush waterColor = new SolidBrush(Color.LightSkyBlue);
|
||||
g.FillRectangle(waterColor, x * x, y * y, x * (x + 1), y * (y + 1));
|
||||
}
|
||||
}
|
||||
Pen pen = new(Color.Black, 3);
|
||||
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user