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.
58 lines
959 B
58 lines
959 B
10 years ago
|
package mightypork.gamecore.input.events;
|
||
10 years ago
|
|
||
10 years ago
|
|
||
10 years ago
|
import mightypork.gamecore.eventbus.BusEvent;
|
||
|
import mightypork.gamecore.eventbus.event_flags.UnloggedEvent;
|
||
|
import mightypork.gamecore.util.math.constraints.vect.Vect;
|
||
|
import mightypork.gamecore.util.math.constraints.vect.VectConst;
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
/**
|
||
|
* Mouse moved
|
||
|
*
|
||
|
* @author MightyPork
|
||
|
*/
|
||
10 years ago
|
@UnloggedEvent
|
||
10 years ago
|
public class MouseMotionEvent extends BusEvent<MouseMotionListener> {
|
||
10 years ago
|
|
||
10 years ago
|
private final VectConst move;
|
||
|
private final VectConst pos;
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
/**
|
||
|
* @param pos end pos
|
||
|
* @param move move vector
|
||
|
*/
|
||
10 years ago
|
public MouseMotionEvent(Vect pos, Vect move)
|
||
|
{
|
||
10 years ago
|
this.move = move.freeze();
|
||
|
this.pos = pos.freeze();
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
/**
|
||
|
* @return movement since last {@link MouseMotionEvent}
|
||
|
*/
|
||
10 years ago
|
public VectConst getMove()
|
||
10 years ago
|
{
|
||
10 years ago
|
return move;
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
/**
|
||
|
* @return current mouse position
|
||
|
*/
|
||
10 years ago
|
public VectConst getPos()
|
||
10 years ago
|
{
|
||
10 years ago
|
return pos;
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
|
|
||
10 years ago
|
@Override
|
||
10 years ago
|
public void handleBy(MouseMotionListener keh)
|
||
10 years ago
|
{
|
||
|
keh.receive(this);
|
||
|
}
|
||
10 years ago
|
|
||
10 years ago
|
}
|