PIbd-23_Kharlamov_A.A._Stor.../DrawningObjectStormtrooper.java

39 lines
1.0 KiB
Java
Raw Normal View History

import java.awt.*;
public class DrawningObjectStormtrooper implements IDrawningObject {
private DrawingStormtrooper _stormtrooper = null;
public DrawningObjectStormtrooper(DrawingStormtrooper storm){
_stormtrooper = storm;
}
@Override
public float getStep() {
if (_stormtrooper.Stormtrooper != null) {
return _stormtrooper.Stormtrooper.Step;
}
return 0;
}
@Override
public void SetObject(int x, int y, int width, int height) {
if (_stormtrooper != null) _stormtrooper.SetPosition(x, y, width, height);
}
@Override
public void MoveObject(Direction direction) {
if (_stormtrooper!= null) _stormtrooper.MoveTransport(direction);
}
@Override
public void DrawningObject(Graphics g) {
if (_stormtrooper != null) _stormtrooper.DrawTransport((Graphics2D) g);
}
@Override
public float[] GetCurrentPosition() {
if (_stormtrooper != null) {return _stormtrooper.GetCurrentPosition();}
return null;
}
}