ISEbd-22 Alimova M.S. Lab Work 03 #3
@ -1,4 +1,6 @@
|
||||
namespace AirBomber
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AirBomber
|
||||
{
|
||||
public partial class FormAirBomber : Form
|
||||
{
|
||||
@ -33,10 +35,19 @@
|
||||
{
|
||||
Random random = new();
|
||||
Color color = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
||||
//TODO выбор основного цвета
|
||||
ColorDialog colorDialog = new ColorDialog();
|
||||
//TODO выбор основного цвета DONE
|
||||
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
color = colorDialog.Color;
|
||||
}
|
||||
|
||||
Color dopColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
||||
//TODO выбор дополнительного цвета
|
||||
//TODO выбор дополнительного цвета DONE
|
||||
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
dopColor = colorDialog.Color;
|
||||
}
|
||||
|
||||
_drawningAirPlane = new DrawningAirBomber(random.Next(100, 300), random.Next(1000, 3000), color, dopColor,
|
||||
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), pictureBoxAirBomber.Width, pictureBoxAirBomber.Height);
|
||||
|
@ -52,7 +52,9 @@ namespace AirBomber
|
||||
public static int operator +(PlanesGenericCollection<T, U> collect, T? obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return collect?._collection.Insert(obj) ?? -1;
|
||||
}
|
||||
|
||||
@ -62,14 +64,15 @@ namespace AirBomber
|
||||
/// <param name="collect"></param>
|
||||
/// <param name="pos"></param>
|
||||
/// <returns></returns>
|
||||
public static T? operator -(PlanesGenericCollection<T, U> collect, int pos)
|
||||
public static bool operator -(PlanesGenericCollection<T, U> collect, int pos)
|
||||
{
|
||||
T? obj = collect._collection.Get(pos);
|
||||
if (obj != null)
|
||||
{
|
||||
collect._collection.Remove(pos);
|
||||
return true;
|
||||
}
|
||||
return obj;
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Получение объекта IMoveableObject
|
||||
|
@ -88,7 +88,7 @@ namespace AirBomber
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_places[position - 1] = null;
|
||||
_places[position] = null;
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user