Removed hovered target id code into getHovered(int)

This commit is contained in:
Collin Smith 2020-08-29 02:06:52 -07:00
parent d7c4d478a8
commit 45825b8a3d

View File

@ -140,10 +140,15 @@ public class CursorMovementSystem extends BaseSystem {
}
}
private boolean touchDown(int src) {
private int getHovered(int src) {
IntBag hoveredEntities = hoveredSubscriber.getEntities();
if (hoveredEntities.size() == 0) return false;
int target = hoveredEntities.get(0);
if (hoveredEntities.size() == 0) return Engine.INVALID_ENTITY;
return hoveredEntities.get(0);
}
private boolean touchDown(int src) {
int target = getHovered(src);
if (target == Engine.INVALID_ENTITY) return false;
setTarget(src, target);
return true;
}