note
	description: "[
		Encapsulates a mouse button event.
		Any instance represents one button only.
	]"
	author: "Louis Marchand and obnosim"
	date: "Sun Feb 04, 2018"
	revision: "2.0"

deferred class 
	GAME_MOUSE_BUTTON_EVENT

inherit
	GAME_MOUSE_EVENT_COMMON
		rename
			state as button_id
		end

feature -- Access

	is_left_button: BOOLEAN
			-- Is the left button of the mouse the one represented by Current?
		do
			Result := button_id = {GAME_SDL_EXTERNAL}.sdl_button_left
		end

	is_right_button: BOOLEAN
			-- Is the right button of the mouse the one represented by Current?
		do
			Result := button_id = {GAME_SDL_EXTERNAL}.sdl_button_right
		end

	is_middle_button: BOOLEAN
			-- Is the middle button of the mouse the one represented by Current?
		do
			Result := button_id = {GAME_SDL_EXTERNAL}.sdl_button_middle
		end

	is_optional_button_1: BOOLEAN
			-- Is the first optional button of the mouse the one represented by Current?
		do
			Result := button_id = {GAME_SDL_EXTERNAL}.sdl_button_x1
		end

	is_optional_button_2: BOOLEAN
			-- Is the second optional button of the mouse the one represented by Current?
		do
			Result := button_id = {GAME_SDL_EXTERNAL}.sdl_button_x2
		end
	
invariant
	only_one_button: is_left_button.to_integer + is_right_button.to_integer + is_middle_button.to_integer + is_optional_button_1.to_integer + is_optional_button_2.to_integer = 1

end -- class GAME_MOUSE_BUTTON_EVENT

Generated by ISE EiffelStudio