Добавление метода получения координат

This commit is contained in:
prodigygirl 2022-10-22 22:50:30 +04:00
parent 2fd750d255
commit 107ff418db

View File

@ -1,4 +1,5 @@
import java.awt.*;
import java.util.HashMap;
import java.util.Random;
public class DrawingArmoredCar {
@ -120,4 +121,14 @@ public class DrawingArmoredCar {
startPosY = pictureHeight - carHeight;
}
}
public HashMap<String, Float> GetCurrentPosition()
{
HashMap<String, Float> hashMap = new HashMap<String, Float>();
hashMap.put("Left", startPosX);
hashMap.put("Right", startPosX + carWidth);
hashMap.put("Top", startPosY);
hashMap.put("Bottom", startPosY + carHeight);
return hashMap;
}
}