Rogue: Savage Rats, a retro-themed dungeon crawler
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.
 
 
rogue-savage-rats/src/mightypork/gamecore/control/events/input/MouseMotionEvent.java

56 lines
947 B

package mightypork.gamecore.control.events.input;
import mightypork.util.constraints.vect.Vect;
import mightypork.util.constraints.vect.VectConst;
import mightypork.util.control.eventbus.BusEvent;
import mightypork.util.control.eventbus.events.flags.UnloggedEvent;
/**
* Mouse moved
*
* @author MightyPork
*/
@UnloggedEvent
public class MouseMotionEvent extends BusEvent<MouseMotionListener> {
private final VectConst move;
private final VectConst pos;
/**
* @param pos end pos
* @param move move vector
*/
public MouseMotionEvent(Vect pos, Vect move) {
this.move = move.freeze();
this.pos = pos.freeze();
}
/**
* @return movement since last {@link MouseMotionEvent}
*/
public VectConst getMove()
{
return move;
}
/**
* @return current mouse position
*/
public VectConst getPos()
{
return pos;
}
@Override
public void handleBy(MouseMotionListener keh)
{
keh.receive(this);
}
}