23 lines
829 B
Java
23 lines
829 B
Java
package laba1Loco;
|
|
|
|
public class DrawningObjectTrain implements IMoveableObject {
|
|
private DrawingTrain _drawingTrain = null;
|
|
public DrawningObjectTrain(DrawingTrain drawingTrain)
|
|
{
|
|
_drawingTrain = drawingTrain;
|
|
}
|
|
public ObjectParameters GetObjectPosition(){
|
|
if (_drawingTrain == null || _drawingTrain.EntityTrain ==
|
|
null)
|
|
{
|
|
return null;
|
|
}
|
|
return new ObjectParameters(_drawingTrain.GetPosX(),
|
|
_drawingTrain.GetPosY(), _drawingTrain.GetWidth(), _drawingTrain.GetHeight());
|
|
}
|
|
public int GetStep(){ return (int)_drawingTrain.EntityTrain.Step; }
|
|
public boolean CheckCanMove(Direction direction) { return _drawingTrain.CanMove(direction);}
|
|
public void MoveObject(Direction direction) { _drawingTrain.MoveTransport(direction); }
|
|
|
|
}
|