2023-10-09 20:56:26 +04:00
|
|
|
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(){
|
2023-10-10 01:30:20 +04:00
|
|
|
if(_drawningLocomotive == null) return -1;
|
2023-10-09 20:56:26 +04:00
|
|
|
return (int)(_drawningLocomotive.EntityLocomotive.Step());
|
|
|
|
}
|
|
|
|
public boolean CheckCanMove(DyrectionType direction){
|
2023-10-10 01:30:20 +04:00
|
|
|
if(_drawningLocomotive == null) return false;
|
2023-10-09 20:56:26 +04:00
|
|
|
return _drawningLocomotive.CanMove(direction);
|
|
|
|
}
|
|
|
|
public void MoveObject(DyrectionType direction){
|
2023-10-10 01:30:20 +04:00
|
|
|
if(_drawningLocomotive == null) return;
|
|
|
|
_drawningLocomotive.MoveTransport(direction);
|
2023-10-09 20:56:26 +04:00
|
|
|
}
|
|
|
|
}
|