You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
838 B
59 lines
838 B
package mightypork.rogue.bus.events;
|
|
|
|
|
|
import mightypork.utils.control.bus.events.Event;
|
|
import mightypork.utils.math.coord.Coord;
|
|
|
|
|
|
/**
|
|
* Mouse moved
|
|
*
|
|
* @author MightyPork
|
|
*/
|
|
public class MouseMotionEvent implements Event<MouseMotionEvent.Listener> {
|
|
|
|
private final Coord move;
|
|
private final Coord pos;
|
|
|
|
|
|
public MouseMotionEvent(Coord pos, Coord move) {
|
|
this.move = move;
|
|
this.pos = pos;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return movement since last {@link MouseMotionEvent}
|
|
*/
|
|
public Coord getMove()
|
|
{
|
|
return move;
|
|
}
|
|
|
|
|
|
/**
|
|
* @return current mouse position
|
|
*/
|
|
public Coord getPos()
|
|
{
|
|
return pos;
|
|
}
|
|
|
|
|
|
@Override
|
|
public void handleBy(Listener keh)
|
|
{
|
|
keh.receive(this);
|
|
}
|
|
|
|
public interface Listener {
|
|
|
|
/**
|
|
* Handle an event
|
|
*
|
|
* @param event event
|
|
*/
|
|
void receive(MouseMotionEvent event);
|
|
}
|
|
|
|
}
|
|
|