Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Public Member Functions | List of all members
physical_controller Class Reference

A physical controller. More...

#include <physical_controller.h>

Public Member Functions

 physical_controller (const physical_controller_type type=physical_controller_type::keyboard, const key_bindings &kbs=create_left_keyboard_key_bindings(), const mouse_bindings &mbs=mouse_bindings())
 
const key_bindingsget_key_bindings () const
 Get the key bindings, if this is a keyboard.
 
const mouse_bindingsget_mouse_bindings () const
 Get the mouse bindings, if this is a mouse.
 
const physical_controller_typeget_type () const noexcept
 
user_inputs process_input (const sf::Event &event, const side player_side, const game_view_layout &layout) const
 Process the input for this controller.
 
void set_type (const physical_controller_type t) noexcept
 

Detailed Description

A physical controller.

A physical controller is a class that takes input from a mouse or keyboard and converts these into the right 'user_input'. sf::Event -> controllers -> user_input

Constructor & Destructor Documentation

◆ physical_controller()

physical_controller::physical_controller ( const physical_controller_type  type = physical_controller_type::keyboard,
const key_bindings kbs = create_left_keyboard_key_bindings(),
const mouse_bindings mbs = mouse_bindings() 
)
explicit

Member Function Documentation

◆ get_key_bindings()

const key_bindings & physical_controller::get_key_bindings ( ) const

Get the key bindings, if this is a keyboard.

◆ get_mouse_bindings()

const mouse_bindings & physical_controller::get_mouse_bindings ( ) const

Get the mouse bindings, if this is a mouse.

◆ get_type()

const physical_controller_type & physical_controller::get_type ( ) const
inlinenoexcept

◆ process_input()

user_inputs physical_controller::process_input ( const sf::Event &  event,
const side  player_side,
const game_view_layout layout 
) const

Process the input for this controller.

Returns an an empty vector if this controller is uneffected by the event

◆ set_type()

void physical_controller::set_type ( const physical_controller_type  t)
inlinenoexcept

The documentation for this class was generated from the following files: