PIbd-21_Kouvshinoff_T._A._W.../laba1Loco/DrawningObjectTrain.java
2023-10-08 01:10:54 +04:00

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); }
}