Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd25663b40 | |||
| 9ba2080a1a | |||
| fe61d945ef | |||
| 716188a244 | |||
| 5951738489 | |||
| e4d8c8d135 | |||
| 05360275c3 | |||
| e1eb80499e | |||
| 058c5b6249 | |||
| aae1f51ef5 | |||
| 118cc6316c | |||
| 70cbb4b989 |
@@ -67,6 +67,8 @@ namespace AirplaneWithRadar
|
||||
return DrawMapWithObject();
|
||||
}
|
||||
private bool CheckBarriers(float leftMove, float rightMove, float topMove, float bottomMove)
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
{
|
||||
int left = Convert.ToInt32((_drawingObject.GetCurrentPosition().Left + leftMove) / _size_x);
|
||||
int right = Convert.ToInt32((_drawingObject.GetCurrentPosition().Right + rightMove) / _size_x);
|
||||
@@ -86,6 +88,30 @@ namespace AirplaneWithRadar
|
||||
return true;
|
||||
}
|
||||
private bool SetObjectOnMap()
|
||||
>>>>>>> LabWork03
|
||||
{
|
||||
int left = Convert.ToInt32((_drawingObject.GetCurrentPosition().Left + leftMove) / _size_x);
|
||||
int right = Convert.ToInt32((_drawingObject.GetCurrentPosition().Right + rightMove) / _size_x);
|
||||
int top = Convert.ToInt32((_drawingObject.GetCurrentPosition().Top + topMove) / _size_y);
|
||||
int bottom = Convert.ToInt32((_drawingObject.GetCurrentPosition().Bottom + bottomMove) / _size_y);
|
||||
if (top < 0 || left < 0 || right >= _map.GetLength(1) || bottom >= _map.GetLength(0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
for (int i = top; i <= bottom; i++)
|
||||
{
|
||||
for (int j = left; j <= right; j++)
|
||||
{
|
||||
if (_map[j, i] == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private bool SetObjectOnMap()
|
||||
{
|
||||
if (_drawingObject == null || _map == null)
|
||||
{
|
||||
@@ -98,6 +124,15 @@ namespace AirplaneWithRadar
|
||||
{
|
||||
return false;
|
||||
}
|
||||
=======
|
||||
int x = _random.Next(0, 10);
|
||||
int y = _random.Next(0, 10);
|
||||
_drawingObject.SetObject(x, y, _width, _height);
|
||||
if (!CheckBarriers(0, 0, 0, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
>>>>>>> LabWork03
|
||||
return true;
|
||||
}
|
||||
private Bitmap DrawMapWithObject()
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace AirplaneWithRadar
|
||||
/// <summary>
|
||||
/// Высота отрисовки самолета
|
||||
/// </summary>
|
||||
private readonly int _airplaneHeight = 107;
|
||||
private readonly int _airplaneHeight = 108;
|
||||
/// <summary>
|
||||
/// Инициализация свойств
|
||||
/// </summary>
|
||||
@@ -132,8 +132,7 @@ namespace AirplaneWithRadar
|
||||
/// <param name="g"></param>
|
||||
public virtual void DrawTransport(Graphics g)
|
||||
{
|
||||
if (_startPosX < 0 || _startPosY < 0
|
||||
|| !_pictureHeight.HasValue || !_pictureWidth.HasValue)
|
||||
if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,11 @@ namespace AirplaneWithRadar
|
||||
/// <param name="dopColor">Дополнительный цвет</param>
|
||||
/// <param name="radar">Признак наличия радара</param>
|
||||
/// <param name="extraFuelTank">Признак наличия дополнительных топливных баков</param>
|
||||
<<<<<<< HEAD
|
||||
public DrawingAirplaneWithRadar(int speed, float weight, Color bodyColor, Color dopColor, bool radar, bool extraFuelTank) : base(speed, weight, bodyColor, 304, 109)
|
||||
=======
|
||||
public DrawingAirplaneWithRadar(int speed, float weight, Color bodyColor, Color dopColor, bool radar, bool extraFuelTank) : base(speed, weight, bodyColor, 303, 102)
|
||||
>>>>>>> LabWork03
|
||||
{
|
||||
Airplane = new EntityAirplaneWithRadar(speed, weight, bodyColor, dopColor, radar, extraFuelTank);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,11 @@ namespace AirplaneWithRadar
|
||||
public partial class FormAirplaneWithRadar : Form
|
||||
{
|
||||
private DrawingAirplane _airplane;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
public DrawingAirplane SelectedAirplane { get; private set; }
|
||||
|
||||
>>>>>>> LabWork03
|
||||
public FormAirplaneWithRadar()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -49,7 +52,11 @@ namespace AirplaneWithRadar
|
||||
Draw();
|
||||
}
|
||||
/// <summary>
|
||||
<<<<<<< HEAD
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
=======
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
>>>>>>> LabWork03
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
Reference in New Issue
Block a user