готовая laba_2
This commit is contained in:
parent
d00147fea5
commit
5ed8caf82c
@ -68,4 +68,4 @@ namespace RoadTrain.MovementStrategy
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -103,21 +103,19 @@ namespace RoadTrain.DrawingObjects
|
||||
Brush bodyBrush = new SolidBrush(EntityRoadTrain.BodyColor);
|
||||
Brush whiteBrush = new SolidBrush(Color.White);
|
||||
|
||||
|
||||
|
||||
//машина
|
||||
g.DrawRectangle(pen, _startPosX - 20, _startPosY + 50 + 80, 160, 20);
|
||||
g.FillRectangle(bodyBrush, _startPosX - 20, _startPosY + 50 + 80, 160, 20);
|
||||
g.DrawEllipse(pen, _startPosX + 5 - 20, _startPosY + 70 + 80, 30, 30); //колесо
|
||||
g.FillEllipse(bodyBrush, _startPosX + 5 - 20, _startPosY + 70 + 80, 30, 30);
|
||||
g.DrawEllipse(pen, _startPosX + 40 - 20, _startPosY + 70 + 80, 30, 30); //колесо
|
||||
g.FillEllipse(bodyBrush, _startPosX + 40 - 20, _startPosY + 70 + 80, 30, 30);
|
||||
g.DrawEllipse(pen, _startPosX + 120 - 20, _startPosY + 70 + 80, 30, 30); //колесо
|
||||
g.FillEllipse(bodyBrush, _startPosX + 120 - 20, _startPosY + 70 + 80, 30, 30);
|
||||
g.DrawRectangle(pen, _startPosX + 120 - 20, _startPosY + 10 + 80, 40, 40); //кабина
|
||||
g.FillRectangle(bodyBrush, _startPosX + 120 - 20, _startPosY + 10 + 80, 40, 40);
|
||||
g.DrawRectangle(pen, _startPosX + 130 - 20, _startPosY + 20 + 80, 30, 20); //окно
|
||||
g.FillRectangle(whiteBrush, _startPosX + 130 - 20, _startPosY + 20 + 80, 30, 20);
|
||||
g.DrawRectangle(pen, _startPosX, _startPosY + 50, 160, 20);
|
||||
g.FillRectangle(bodyBrush, _startPosX, _startPosY + 50, 160, 20);
|
||||
g.DrawEllipse(pen, _startPosX + 5, _startPosY + 70, 30, 30); //колесо
|
||||
g.FillEllipse(bodyBrush, _startPosX + 5, _startPosY + 70 , 30, 30);
|
||||
g.DrawEllipse(pen, _startPosX + 40, _startPosY + 70, 30, 30); //колесо
|
||||
g.FillEllipse(bodyBrush, _startPosX + 40, _startPosY + 70, 30, 30);
|
||||
g.DrawEllipse(pen, _startPosX + 120, _startPosY + 70, 30, 30); //колесо
|
||||
g.FillEllipse(bodyBrush, _startPosX + 120, _startPosY + 70, 30, 30);
|
||||
g.DrawRectangle(pen, _startPosX + 120, _startPosY + 10, 40, 40); //кабина
|
||||
g.FillRectangle(bodyBrush, _startPosX + 120, _startPosY + 10, 40, 40);
|
||||
g.DrawRectangle(pen, _startPosX + 130, _startPosY + 20, 30, 20); //окно
|
||||
g.FillRectangle(whiteBrush, _startPosX + 130, _startPosY + 20, 30, 20);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ namespace RoadTrain.DrawingObjects
|
||||
{
|
||||
public DrawingRoadTrainWithTank(int speed, double weight, Color bodyColor, Color
|
||||
additionalColor, bool pipes, bool section, int width, int height)
|
||||
: base(speed, weight, bodyColor, width, height, 185, 180)
|
||||
: base(speed, weight, bodyColor, width, height, 200, 100)
|
||||
{
|
||||
if (EntityRoadTrain != null)
|
||||
{
|
||||
@ -34,15 +34,15 @@ namespace RoadTrain.DrawingObjects
|
||||
Brush brGray = new SolidBrush(Color.Gray);
|
||||
if (roadTrain.Brush)
|
||||
{
|
||||
g.DrawLine(pen, _startPosX + 160-20, _startPosY + 70 + 80, _startPosX + 180, _startPosY + 80 + 80);
|
||||
g.DrawRectangle(pen, _startPosX + 170-20, _startPosY + 80 + 80, 40, 10); //щетка
|
||||
g.FillRectangle(additionalBrush, _startPosX + 170-20, _startPosY + 80 + 80, 40, 10);
|
||||
g.DrawLine(pen, _startPosX + 160, _startPosY + 70, _startPosX + 180, _startPosY + 80);
|
||||
g.DrawRectangle(pen, _startPosX + 170, _startPosY + 80, 40, 10); //щетка
|
||||
g.FillRectangle(additionalBrush, _startPosX + 170, _startPosY + 80, 40, 10);
|
||||
}
|
||||
//бак
|
||||
if (roadTrain.Tank)
|
||||
{
|
||||
g.DrawRectangle(pen, _startPosX + 10 - 20, _startPosY + 80, 90, 50); //бак с водой
|
||||
g.FillRectangle(additionalBrush, _startPosX + 10-20, _startPosY + 80, 90, 50);
|
||||
g.DrawRectangle(pen, _startPosX + 10, _startPosY, 90, 50); //бак с водой
|
||||
g.FillRectangle(additionalBrush, _startPosX + 10, _startPosY, 90, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ namespace RoadTrain.MovementStrategy
|
||||
objParams.RightBorder + GetStep() >= FieldWidth &&
|
||||
objParams.DownBorder <= FieldHeight &&
|
||||
objParams.DownBorder + GetStep() >= FieldHeight;
|
||||
|
||||
}
|
||||
protected override void MoveToTarget()
|
||||
{
|
||||
|
@ -114,4 +114,4 @@ namespace RoadTrain
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user