using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace V3.Input.Internal
{
///
/// Default implementation of an event that is sent when a mouse button is
/// pressed or released.
///
internal sealed class MouseEvent : IMouseEvent
{
///
/// The mouse button that was pressed or released.
///
public MouseButton MouseButton { get; }
///
/// The state of the mouse button (pressed or released?).
///
public ButtonState ButtonState { get; }
///
/// The position where the mouse button was pressed the last time.
///
public Point PositionPressed { get; }
///
/// The position where the mouse button was released if this is a
/// release event, null otherwise.
///
public Point? PositionReleased { get; }
///
/// True if PositionReleased is a valid on-screen position, otherwise
/// false.
///
public bool ReleasedOnScreen { get; }
///
/// Creates a new mouse event with the given data.
///
/// the mouse button that was pressed or
/// released
/// the type of the event (pressed or
/// released?)
/// the position of the last press of
/// the button
/// the position of the release of the
/// button if this is a release event, or null otherwise
/// true if positionReleased is a valid
/// on-screen position.
public MouseEvent(MouseButton mouseButton, ButtonState buttonState, Point positionPressed, Point? positionReleased, bool releasedOnScreen)
{
MouseButton = mouseButton;
ButtonState = buttonState;
PositionPressed = positionPressed;
PositionReleased = positionReleased;
ReleasedOnScreen = releasedOnScreen;
}
}
}