Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static boolean interact(String action, String objName, Position nearLoc) {
- double nearest = 9999;
- SceneObject obj = null;
- for (SceneObject object : SceneObjects.getLoaded()) {
- double dis = object.distance(nearLoc);
- if (nearest > dis) {
- nearest = dis;
- obj = object;
- }
- }
- return obj != null && obj.interact(action);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement