37 lines
1019 B
Java
37 lines
1019 B
Java
|
package Trolleybus;
|
||
|
|
||
|
public class DrawingObjectBus implements IMoveableObject {
|
||
|
private final DrawingBus _drawingBus;
|
||
|
|
||
|
public DrawingObjectBus(DrawingBus drawingBus){
|
||
|
_drawingBus = drawingBus;
|
||
|
}
|
||
|
|
||
|
public ObjectParameters GetObjectPosition(){
|
||
|
if (_drawingBus == null || _drawingBus.EntityBus == null) {
|
||
|
return null;
|
||
|
}
|
||
|
return new ObjectParameters(_drawingBus.GetPosX(), _drawingBus.GetPosY(), _drawingBus.GetWidth(), _drawingBus.GetHeight());
|
||
|
}
|
||
|
|
||
|
public int GetStep(){
|
||
|
if (_drawingBus.EntityBus == null) {
|
||
|
return 0;
|
||
|
}
|
||
|
return (int)_drawingBus.EntityBus.Step;
|
||
|
}
|
||
|
|
||
|
public boolean CheckCanMove(DirectionType direction){
|
||
|
if (_drawingBus == null) {
|
||
|
return false;
|
||
|
}
|
||
|
return _drawingBus.CanMove(direction);
|
||
|
}
|
||
|
|
||
|
public void MoveObject(DirectionType direction){
|
||
|
if (_drawingBus == null) {
|
||
|
return;
|
||
|
}
|
||
|
_drawingBus.MoveTransport(direction);
|
||
|
}
|
||
|
}
|