PIbd-22_Bondarenko_M.S._War.../DrawningObjectShip.java
Макс Бондаренко 097cb7f944 готово 4
2022-12-15 22:31:51 +04:00

41 lines
1021 B
Java

import java.awt.*;
public class DrawningObjectShip implements IDrawningObject {
private DrawingShip _warmlyShip = null;
public DrawningObjectShip(DrawingShip warmlyShip)
{
_warmlyShip = warmlyShip;
}
public DrawingShip getDrawingShip() {return _warmlyShip;}
@Override
public float getStep() {
if (_warmlyShip == null || _warmlyShip.warmlyShip == null) return 0;
return _warmlyShip.warmlyShip.GetStep();
}
@Override
public void SetObject(int x, int y, int width, int height) {
_warmlyShip.SetPosition(x, y, width, height);
}
@Override
public void MoveObject(Direction direction) {
_warmlyShip.MoveTransport(direction);
}
@Override
public void DrawningObject(Graphics g) {
_warmlyShip.DrawTransport(g);
}
@Override
public float[] GetCurrentPosition() {
if (_warmlyShip == null || _warmlyShip.warmlyShip == null) return null;
return _warmlyShip.GetCurrentPosition();
}
}