29 lines
1002 B
Java

package ProjectElectricLocomotive;
public class DrawingObjectLocomotive implements IMoveableObject {
private DrawingLocomotive _drawningLocomotive = null;
public DrawingObjectLocomotive(DrawingLocomotive drawningLocomotive)
{
_drawningLocomotive = drawningLocomotive;
}
public ObjectParameters GetObjectPosition()
{
if (_drawningLocomotive == null || _drawningLocomotive.EntityLocomotive == null)
{
return null;
}
return new ObjectParameters(_drawningLocomotive.GetPosX(), _drawningLocomotive.GetPosY(),
_drawningLocomotive.GetWidth(), _drawningLocomotive.GetHeight());
}
public int GetStep(){
return (int)(_drawningLocomotive.EntityLocomotive.Step());
}
public boolean CheckCanMove(DyrectionType direction){
return _drawningLocomotive.CanMove(direction);
}
public void MoveObject(DyrectionType direction){
_drawningLocomotive.MoveTransport(direction);
}
}