Добален дополнительный конструктор и метод стал virtual
This commit is contained in:
parent
40820059a5
commit
fbd570c22d
@ -15,10 +15,18 @@ namespace Artilleries
|
|||||||
private int? _pictureHeight = null;
|
private int? _pictureHeight = null;
|
||||||
private readonly int _artilleryWidth = 80;
|
private readonly int _artilleryWidth = 80;
|
||||||
private readonly int _artilleryHeight = 50;
|
private readonly int _artilleryHeight = 50;
|
||||||
|
|
||||||
public DrawingArtillery(int speed, float weight, Color bodyColor)
|
public DrawingArtillery(int speed, float weight, Color bodyColor)
|
||||||
{
|
{
|
||||||
Artillery = new EntityArtillery(speed, weight, bodyColor);
|
Artillery = new EntityArtillery(speed, weight, bodyColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected DrawingArtillery(int speed, float weight, Color bodyColor, int artilleryWidth, int artilleryHeight) : this(speed, weight, bodyColor)
|
||||||
|
{
|
||||||
|
_artilleryWidth = artilleryWidth;
|
||||||
|
_artilleryHeight = artilleryHeight;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetPosition(int x, int y, int width, int height)
|
public void SetPosition(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
if (x < 0 || x + _artilleryWidth >= width)
|
if (x < 0 || x + _artilleryWidth >= width)
|
||||||
@ -73,7 +81,7 @@ namespace Artilleries
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawTransport(Graphics g)
|
public virtual void DrawTransport(Graphics g)
|
||||||
{
|
{
|
||||||
if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue)
|
if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user