32 lines
1.1 KiB
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(){
if(_drawningLocomotive == null) return -1;
return (int)(_drawningLocomotive.EntityLocomotive.Step());
}
public boolean CheckCanMove(DyrectionType direction){
if(_drawningLocomotive == null) return false;
return _drawningLocomotive.CanMove(direction);
}
public void MoveObject(DyrectionType direction){
if(_drawningLocomotive == null) return;
_drawningLocomotive.MoveTransport(direction);
}
}