Files
2024-03-28 10:49:03 +04:00

25 lines
815 B
Java

package MovementStrategy;
import Drawnings.DrawningTrans;
public class MoveableTrans implements IMoveableObject {
private DrawningTrans _trans = null;
public MoveableTrans(DrawningTrans drawningTrans)
{
_trans = drawningTrans;
}
public ObjectParameters GetObjectPosition()
{
if (_trans == null || _trans.getEntityTrans() == null)
{
return null;
}
return new ObjectParameters(_trans.GetPosX(), _trans.GetPosY(), _trans.GetWidth(), _trans.GetHeight());
}
public int GetStep() { return (int) _trans.getEntityTrans().getStep(); }
public boolean TryMoveObject(MovementDirection direction) { return _trans.moveTransport(direction); }
public void MoveObject(MovementDirection direction) { _trans.moveTransport(direction); }
}