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/input/events/MouseMotionEvent.java

56 lines
955 B

package mightypork.gamecore.input.events;
import mightypork.utils.eventbus.BusEvent;
import mightypork.utils.eventbus.events.flags.NotLoggedEvent;
import mightypork.utils.math.constraints.vect.Vect;
import mightypork.utils.math.constraints.vect.VectConst;
/**
* Mouse moved
*
* @author Ondřej Hruška (MightyPork)
*/
@NotLoggedEvent
public class MouseMotionEvent extends BusEvent<MouseMotionHandler> {
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(MouseMotionHandler keh)
{
keh.receive(this);
}
}